-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Iterate on ItemsView
and KeysView
#3181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
... to match the behavior of `Set` and `AbstractSet`
... to match the behavior of `Set` and `AbstractSet`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply and thank you for the PR. Remarks below.
In reference to #3184: Let's make this consistent for the annotation of |
Co-Authored-By: Sebastian Rittau <srittau@rittau.biz>
I just applied the suggestions you made. But just wait a minute: I used |
I think an unbound type var is basically equivalent to |
Thanks for explaining. |
This was discussed in #3181 and the correct explanation was given that object ought to be preferred here. In practice this caused an obscure issue with mypy when using this operations on the results of six.viewkeys(), since it decided that it wanted a mapping *from* object as a result of inference contexts. Grumble.
…3294) This was discussed in #3181 and the correct explanation was given that object ought to be preferred here. In practice this caused an obscure issue with mypy when using this operations on the results of six.viewkeys(), since it decided that it wanted a mapping *from* object as a result of inference contexts. Grumble.
Set
s__sub__
aka-
akadifference
return the Left not a union (this also matches the implementation ofAbstractSet
__and__
aka&
akaintersection
also returns Left. This is also consistent withAbstractSet
andSet
Related python/mypy#7236