Skip to content

Commit 09a0f41

Browse files
add comment for Container[Any] usage in Collection
1 parent 2602adc commit 09a0f41

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

stdlib/typing.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,7 @@ class Container(Protocol[_T_contra]):
648648

649649
@runtime_checkable
650650
class Collection(Iterable[_T_co], Container[Any], Protocol[_T_co]):
651+
# Note: need to use Container[Any] instead of Container[_T_co] to ensure covariance.
651652
# Implement Sized (but don't have it as a base class).
652653
@abstractmethod
653654
def __len__(self) -> int: ...

0 commit comments

Comments
 (0)