Closed
Description
In collections.abc
, Sequence
, Mapping
, and Set
all inherit from Container
.
In typing
, Sequence[T]
inherits from Container[T]
, while Mapping[T]
and AbstractSet[T]
do not, and instead define __contains__
, which means Container
picks them up as a Protocol
. Unless there's a reason these have to work differently, it seems like they should all inherit.
Also, Container
doesn't annotate its __contains__
method at all, and Mapping
and AbstractSet
annotate it as taking an object
. Shouldn't these all be requiring T
?