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

Understand how _ignore_ attribute affects Enum subclasses #12157

Open
kstauffer opened this issue Feb 9, 2022 · 0 comments
Open

Understand how _ignore_ attribute affects Enum subclasses #12157

kstauffer opened this issue Feb 9, 2022 · 0 comments

Comments

@kstauffer
Copy link
Contributor

Feature
In code like this, mypy should raise the indicated error:

class Some(Enum):
   a = 1
   b = 2
   _ignore_ = ('a',)

reveal_type(Some.a) # E: "Type[Some]" has no attribute "a"

mypy should understand the effect that _ignore_ has in Enum subclasses.

This issue is a follow-on to PR #12128.

@kstauffer kstauffer changed the title Understand how _ignore_ attributes affects Enum subclasses Understand how _ignore_ attribute affects Enum subclasses Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants