Skip to content

Commit d556d17

Browse files
committed
reorder overloads; add comment
1 parent 1514582 commit d556d17

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

stdlib/builtins.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,10 +784,12 @@ class slice:
784784
def indices(self, __len: SupportsIndex) -> tuple[int, int, int]: ...
785785

786786
class tuple(Sequence[_T_co], Generic[_T_co]):
787-
@overload
788-
def __new__(cls) -> tuple[()]: ...
787+
# overloads are ordered this way to pass `isinstance` checks
788+
# see: https://github.com/python/typeshed/pull/7454#issuecomment-1061490888
789789
@overload
790790
def __new__(cls: type[Self], __iterable: Iterable[_T_co]) -> Self: ...
791+
@overload
792+
def __new__(cls) -> tuple[()]: ...
791793
def __len__(self) -> int: ...
792794
def __contains__(self, __x: object) -> bool: ...
793795
@overload

0 commit comments

Comments
 (0)