Skip to content

Commit 0d2c2fe

Browse files
authored
commit
1 parent 1cb63c8 commit 0d2c2fe

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

stdlib/builtins.pyi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,16 @@ class memoryview(Sequence[_I]):
10551055
class bool(int):
10561056
def __new__(cls, o: object = False, /) -> Self: ...
10571057

1058+
@overload
1059+
def __int__(self: Literal[True]) -> Literal[1]: ...
1060+
@overload
1061+
def __int__(self: Literal[False]) -> Literal[0]: ...
1062+
1063+
@overload
1064+
def __index__(self: Literal[True]) -> Literal[1]: ...
1065+
@overload
1066+
def __index__(self: Literal[False]) -> Literal[0]: ...
1067+
10581068
# The following overloads could be represented more elegantly with a TypeVar("_B", bool, int),
10591069
# however mypy has a bug regarding TypeVar constraints (https://github.com/python/mypy/issues/11880).
10601070
@overload

0 commit comments

Comments
 (0)