Skip to content

Understand how _ignore_ attribute affects Enum subclasses #12157

Open
@kstauffer

Description

@kstauffer

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions