Skip to content

Commit 235a504

Browse files
committed
Simplify signature of len()
It's still more complex than should be necessary because mypy doesn't consider tuple a subclass of Sized (this is a bug).
1 parent 03a0c26 commit 235a504

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

stubs/3.2/builtins.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,10 +640,7 @@ def isinstance(o: object, t: Union[type, tuple]) -> bool: pass
640640
def issubclass(cls: type, classinfo: type) -> bool: pass
641641
# TODO support this
642642
#def issubclass(type cld, classinfo: Sequence[type]) -> bool: pass
643-
@overload
644-
def len(o: Sized) -> int: pass
645-
@overload
646-
def len(o: tuple) -> int: pass
643+
def len(o: Union[Sized, tuple]) -> int: pass
647644
def license() -> None: pass
648645
def locals() -> Dict[str, Any]: pass
649646
@overload

0 commit comments

Comments
 (0)