Skip to content

Commit 5bbba5d

Browse files
authored
Collection is Sized (#8977)
1 parent e15e007 commit 5bbba5d

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

stdlib/builtins.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ class bytearray(MutableSequence[int], ByteString):
805805
def __alloc__(self) -> int: ...
806806

807807
@final
808-
class memoryview(Sized, Sequence[int]):
808+
class memoryview(Sequence[int]):
809809
@property
810810
def format(self) -> str: ...
811811
@property

stdlib/typing.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,10 +452,7 @@ class Container(Protocol[_T_co]):
452452
def __contains__(self, __x: object) -> bool: ...
453453

454454
@runtime_checkable
455-
class Collection(Iterable[_T_co], Container[_T_co], Protocol[_T_co]):
456-
# Implement Sized (but don't have it as a base class).
457-
@abstractmethod
458-
def __len__(self) -> int: ...
455+
class Collection(Sized, Iterable[_T_co], Container[_T_co], Protocol[_T_co]): ...
459456

460457
class Sequence(Collection[_T_co], Reversible[_T_co], Generic[_T_co]):
461458
@overload

0 commit comments

Comments
 (0)