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
typecheck/Enum: fix crash in Enum attributes check #6822
Conversation
Pull Request Test Coverage Report for Build 2444476621
π - Coveralls |
This comment has been minimized.
This comment has been minimized.
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 for the speedy work. Needs a short release note in 2.14/full.rst
# Renamed in Python 3.10 to `EnumType` | ||
return metaclass.qname() in {"enum.EnumMeta", "enum.EnumType"} | ||
if metaclass.qname() in {"enum.EnumMeta", "enum.EnumType"}: | ||
return not _enum_has_attribute(owner, node) |
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.
Outside the scope of this PR, since status quo, but this looks fragile against importing enum
under an alias, which @DanielNoord was just looking into at pylint-dev/astroid#1587. Probably worth a follow-up issue.
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.
Yeah, we should probably revisit this when we bump to 2.12
.
π€ Effect of this PR on checked open source code: π€ Effect on pytest:
This comment was generated for commit 6c9bcbb |
Type of Changes
Description
Fixes #6805 by:
__new__