Skip to content

Commit a4059c2

Browse files
added SupportsBool
1 parent d262beb commit a4059c2

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

stdlib/_typeshed/__init__.pyi

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,19 +82,22 @@ class SupportsNext(Protocol[_T_co]):
8282
class SupportsAnext(Protocol[_T_co]):
8383
def __anext__(self) -> Awaitable[_T_co]: ...
8484

85+
class SupportsBool(Protocol):
86+
def __bool__(self) -> bool: ...
87+
8588
# Comparison protocols
8689

8790
class SupportsDunderLT(Protocol[_T_contra]):
88-
def __lt__(self, other: _T_contra, /) -> bool: ...
91+
def __lt__(self, other: _T_contra, /) -> SupportsBool: ...
8992

9093
class SupportsDunderGT(Protocol[_T_contra]):
91-
def __gt__(self, other: _T_contra, /) -> bool: ...
94+
def __gt__(self, other: _T_contra, /) -> SupportsBool: ...
9295

9396
class SupportsDunderLE(Protocol[_T_contra]):
94-
def __le__(self, other: _T_contra, /) -> bool: ...
97+
def __le__(self, other: _T_contra, /) -> SupportsBool: ...
9598

9699
class SupportsDunderGE(Protocol[_T_contra]):
97-
def __ge__(self, other: _T_contra, /) -> bool: ...
100+
def __ge__(self, other: _T_contra, /) -> SupportsBool: ...
98101

99102
class SupportsAllComparisons(
100103
SupportsDunderLT[Any], SupportsDunderGT[Any], SupportsDunderLE[Any], SupportsDunderGE[Any], Protocol

0 commit comments

Comments
 (0)