File size: 407 Bytes
114594c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
from typing import TypeVar, Protocol
T = TypeVar('T')
class RingElement(Protocol):
"""A ring element.
Must support ``+``, ``-``, ``*``, ``**`` and ``-``.
"""
def __add__(self: T, other: T, /) -> T: ...
def __sub__(self: T, other: T, /) -> T: ...
def __mul__(self: T, other: T, /) -> T: ...
def __pow__(self: T, other: int, /) -> T: ...
def __neg__(self: T, /) -> T: ...
|