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

Update AbstractSet instead of set in random and inspect #6574

Merged
merged 2 commits into from
Dec 13, 2021

Conversation

JukkaL
Copy link
Contributor

@JukkaL JukkaL commented Dec 13, 2021

collections.abc.Set was accidentally replaced with set in #6346.
The prior is an alias to typing.AbstractSet, instead of
builtins.set.

Since collections.abc.Set is easily confused with typing.Set, it
seems clearer to call it AbstractSet here.

`collections.abc.Set` was accidentally replaced with `set` in python#6346.
The prior is an alias to `typing.AbstractSet`, instead of
`builtins.set`.

Since `collections.abc.Set` is easily confused with `typing.Set`, it
seems clearer to use `typing.AbstractSet` here.
@github-actions

This comment has been minimized.

@AlexWaygood
Copy link
Member

Thanks for the catch!

@@ -23,7 +23,7 @@ from types import (
if sys.version_info >= (3, 7):
from types import ClassMethodDescriptorType, WrapperDescriptorType, MemberDescriptorType, MethodDescriptorType

from typing import Any, ClassVar, NamedTuple, Protocol, Tuple, Type, TypeVar, Union
from typing import AbstractSet, Any, ClassVar, NamedTuple, Protocol, Tuple, Type, TypeVar, Union
Copy link
Collaborator

Choose a reason for hiding this comment

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

Considering that we prefer to use imports from collections.abc, I'd suggest to use from collections.abc import Set as AbstractSet. Best of both worlds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@github-actions
Copy link
Contributor

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

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.

None yet

3 participants