Skip to content

Commit bcaf2fc

Browse files
committed
commit
1 parent 5359254 commit bcaf2fc

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
@@ -1060,6 +1060,16 @@ class memoryview(Sequence[_I]):
10601060
class bool(int):
10611061
def __new__(cls, o: object = False, /) -> Self: ...
10621062

1063+
@overload
1064+
def __int__(self: Literal[True]) -> Literal[1]: ...
1065+
@overload
1066+
def __int__(self: Literal[False]) -> Literal[0]: ...
1067+
1068+
@overload
1069+
def __index__(self: Literal[True]) -> Literal[1]: ...
1070+
@overload
1071+
def __index__(self: Literal[False]) -> Literal[0]: ...
1072+
10631073
# The following overloads could be represented more elegantly with a TypeVar("_B", bool, int),
10641074
# however mypy has a bug regarding TypeVar constraints (https://github.com/python/mypy/issues/11880).
10651075
@overload

0 commit comments

Comments
 (0)