max() uses SupportsGreaterThanT (#6342)

Add SupportsGreaterThan and SupportsGreaterThanT

Closes: #6336

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Sebastian Rittau
2021-11-21 13:28:46 +01:00
committed by GitHub
parent b2b7cebb65
commit a6e369906d
2 changed files with 14 additions and 7 deletions

View File

@@ -40,6 +40,11 @@ class SupportsLessThan(Protocol):
SupportsLessThanT = TypeVar("SupportsLessThanT", bound=SupportsLessThan) # noqa: Y001
class SupportsGreaterThan(Protocol):
def __gt__(self, __other: Any) -> bool: ...
SupportsGreaterThanT = TypeVar("SupportsGreaterThanT", bound=SupportsGreaterThan) # noqa: Y001
class SupportsDivMod(Protocol[_T_contra, _T_co]):
def __divmod__(self, __other: _T_contra) -> _T_co: ...