typeshed
typeshed copied to clipboard
Annotations for `set.__sub__` and related methods are inconsistent
According to the documentation s1 - s2
returns the set of all elements that are in s1
but not in s2
. So what's the point of constraining s2
elements type? I believe the correct annotation for the argument of set.__sub__
would be AbstractSet[object]
rather than AbstractSet[T | None]
.
https://github.com/python/typeshed/blob/cf9bdc2d9861cb61e76b512988d19afe232a958f/stdlib/builtins.pyi#L1100