You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to be a bug in the definition of ItemsView in typing.py: it has three type parameters, but its unclear what they mean. When looking at the corresponding definition in typeshed, it actually makes more sense:
Here MappingView is not generic (since Sized isn't), and ItemsView has only two parameters, clearly meant for keys and values, and clarified by the __contains__ and __iter__ signatures.
I think we should follow this example.
The text was updated successfully, but these errors were encountered:
I have a questions here. What is the reason to have Set in bases for ItemsView, probably it should be AbstractSet. At least in collections.abc both ItemsView and KeysView inherit from collections.abc.Set. Therefore in both cases it is reasonable to use typing.AbstractSet which is a generic version of collections.abc.Set.
This came up in #136 (comment).
There seems to be a bug in the definition of ItemsView in typing.py: it has three type parameters, but its unclear what they mean. When looking at the corresponding definition in typeshed, it actually makes more sense:
Here MappingView is not generic (since Sized isn't), and ItemsView has only two parameters, clearly meant for keys and values, and clarified by the
__contains__
and__iter__
signatures.I think we should follow this example.
The text was updated successfully, but these errors were encountered: