Improved definition of divmod function in builtins (#5114)

Co-authored-by: Eric Traut <erictr@microsoft.com>
This commit is contained in:
Eric Traut
2021-03-15 03:10:09 -07:00
committed by GitHub
parent 30fc2b8cd0
commit 29c3d67626
2 changed files with 13 additions and 4 deletions

View File

@@ -31,6 +31,12 @@ class SupportsLessThan(Protocol):
SupportsLessThanT = TypeVar("SupportsLessThanT", bound=SupportsLessThan) # noqa: Y001
class SupportsDivMod(Protocol[_T_contra, _T_co]):
def __divmod__(self, __other: _T_contra) -> _T_co: ...
class SupportsRDivMod(Protocol[_T_contra, _T_co]):
def __rdivmod__(self, __other: _T_contra) -> _T_co: ...
# Mapping-like protocols
class SupportsItems(Protocol[_KT_co, _VT_co]):