Skip to content

Commit 3b645bf

Browse files
Simplify overloads
Co-authored-by: Alex Waygood <[email protected]>
1 parent d2541c9 commit 3b645bf

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

stdlib/builtins.pyi

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -906,14 +906,12 @@ class _Falsy(Protocol):
906906

907907
@final
908908
class bool(int):
909-
@overload
910-
def __new__(cls) -> Literal[False]: ...
911909
@overload
912910
def __new__(cls, __o: _Truthy) -> Literal[True]: ...
913911
@overload
914-
def __new__(cls, __o: _Falsy) -> Literal[False]: ...
912+
def __new__(cls, __o: _Falsy = ...) -> Literal[False]: ...
915913
@overload
916-
def __new__(cls, __o: object = ...) -> Self: ...
914+
def __new__(cls, __o: object) -> Self: ...
917915
# The following overloads could be represented more elegantly with a TypeVar("_B", bool, int),
918916
# however mypy has a bug regarding TypeVar constraints (https://github.com/python/mypy/issues/11880).
919917
@overload

0 commit comments

Comments
 (0)