Skip to content

Always alias collections.abc.Set - #6712

Merged
srittau merged 7 commits into
python:masterfrom
AlexWaygood:abstract-set
Dec 27, 2021
Merged

srittau merged 7 commits into
python:masterfrom
AlexWaygood:abstract-set

Conversation

@AlexWaygood

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@srittau srittau left a comment

Copy link
Copy Markdown
Collaborator

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