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?
In
collections.abc,Sequence,Mapping, andSetall inherit fromContainer.In
typing,Sequence[T]inherits fromContainer[T], whileMapping[T]andAbstractSet[T]do not, and instead define__contains__, which meansContainerpicks them up as aProtocol. Unless there's a reason these have to work differently, it seems like they should all inherit.Also,
Containerdoesn't annotate its__contains__method at all, andMappingandAbstractSetannotate it as taking anobject. Shouldn't these all be requiringT?