from enum import Enum
value: Enum
reveal_type(value)
reveal_type(value.name)
> mypy --python-version 3.10 test.py
test.py:5: note: Revealed type is "enum.Enum"
test.py:6: note: Revealed type is "str"
Success: no issues found in 1 source file
> mypy --python-version 3.11 test.py
test.py:5: note: Revealed type is "enum.Enum"
test.py:6: note: Revealed type is "Any"
Success: no issues found in 1 source file
in 3.11 name is decorated with enum.property which is a subtype of types.DynamicClassAttribute (aka, builtins.property)
from python/typeshed#7564
Related #12220
in 3.11
nameis decorated withenum.propertywhich is a subtype oftypes.DynamicClassAttribute(aka,builtins.property)from python/typeshed#7564
Related #12220