-
Notifications
You must be signed in to change notification settings - Fork 23
Improve several error codes so attribute access of names is recognised #161
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could you add a changelog entry?
Sure |
Flagged by PyCQA/flake8-pyi#161
typeshed PR here: python/typeshed#7079 |
Done :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
Flagged by PyCQA/flake8-pyi#161
Several error codes had issues due to the fact that the plugin hardcoded names such as
Literal
orUnion
into the logic, but did not consider that a user might access these names via attribute access, e.g.typing_extensions.Literal
ortyping.Union
. For example, the plugin recognisedX: TypeAlias = int
as a valid type alias, but did not recogniseX: typing.TypeAlias = int
as a valid type alias. It's not standard "typeshed style" to access names in that way, but it's nonetheless valid, so we should probably account for that possibility.This PR fixes these bugs.