Skip to content

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!

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.

3 participants