Revert "Let SupportsDunderLT return SupportsBool instead of `bool… (#14373)

Revert "Let `SupportsDunderLT` return `SupportsBool` instead of `bool`. (#12939)"

This reverts commit aed8025d62.
This commit is contained in:
Sebastian Rittau
2025-07-07 16:25:23 +02:00
committed by GitHub
parent edc3e3a89c
commit 096cf56da3
+4 -7
View File
@@ -82,22 +82,19 @@ class SupportsNext(Protocol[_T_co]):
class SupportsAnext(Protocol[_T_co]):
def __anext__(self) -> Awaitable[_T_co]: ...
class SupportsBool(Protocol):
def __bool__(self) -> bool: ...
# Comparison protocols
class SupportsDunderLT(Protocol[_T_contra]):
def __lt__(self, other: _T_contra, /) -> SupportsBool: ...
def __lt__(self, other: _T_contra, /) -> bool: ...
class SupportsDunderGT(Protocol[_T_contra]):
def __gt__(self, other: _T_contra, /) -> SupportsBool: ...
def __gt__(self, other: _T_contra, /) -> bool: ...
class SupportsDunderLE(Protocol[_T_contra]):
def __le__(self, other: _T_contra, /) -> SupportsBool: ...
def __le__(self, other: _T_contra, /) -> bool: ...
class SupportsDunderGE(Protocol[_T_contra]):
def __ge__(self, other: _T_contra, /) -> SupportsBool: ...
def __ge__(self, other: _T_contra, /) -> bool: ...
class SupportsAllComparisons(
SupportsDunderLT[Any], SupportsDunderGT[Any], SupportsDunderLE[Any], SupportsDunderGE[Any], Protocol