Skip to content

Always alias collections.abc.Set #6712

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

Merged
merged 7 commits into from
Dec 27, 2021
Merged

Conversation

AlexWaygood
Copy link
Member

As discussed in #6574, it is very easy to confuse collections.abc.Set with typing.Set (collections.abc.Set is, in fact, equivalent to typing.AbstractSet, rather than builtins.set/typing.Set).

This PR proposes only ever importing collections.abc.Set with the alias AbstractSet.

@AlexWaygood AlexWaygood marked this pull request as ready for review December 27, 2021 15:58
@github-actions
Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

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.

Good idea.

@srittau srittau merged commit 975b3e9 into python:master Dec 27, 2021
@AlexWaygood AlexWaygood deleted the abstract-set branch December 27, 2021 16:12
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.

2 participants