Skip to content
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

Add missing methods to ItemsView and KeysView, including isdisjoint #2997

Merged
merged 3 commits into from
May 20, 2019
Merged

Add missing methods to ItemsView and KeysView, including isdisjoint #2997

merged 3 commits into from
May 20, 2019

Conversation

vr2262
Copy link
Contributor

@vr2262 vr2262 commented May 18, 2019

Fixes #2919

Unsure whether to write out the signatures of the various __r operator methods or do (for example)

__ror__ = __or__

which is what collection.abc.Set does. I opted to write them out explicitly.

Also unsure whether the change to isdisjoint is valid given the #TODO comment.

Copy link
Collaborator

@srittau srittau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I also prefer the explicit annotations of __ror__ et al, but it's mainly down to preference. the change to disjoint() looks good to me as well.

I am going to merge this, since the return values of the added methods match those of the existing ones, but I wonder why abstract return types where originally used when the views usually return quite concrete types.

@srittau srittau merged commit 07d4938 into python:master May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unsupported operand types for - ("KeysView[str]" and "Tuple[str, ...]")
2 participants