Open
Description
Consider this example:
from enum import Enum, member
class Pet(Enum):
__CAT = member(1)
reveal_type(Pet.__CAT) # N: Revealed type is "enum.member[Literal[1]?]"
Link: https://mypy-play.net/?mypy=latest&python=3.12&gist=63b056215c22ba7ff09e2559dd2ae08a
However, in runtimes it fails with AttributeError
, because __CAT
is mangled to _Pet__CAT
as regular private names are.
We need to fix this corner-case.