Skip to content

[3.12] EnumMeta.__getattr__ removed without deprecation #106762

Description

@jacobtylerwalls

Bug report

>>> from enum import Enum
>>> class Color(Enum):
...     RED = "red"
... 

3.11

>>> Color.__getattr__("RED")
<Color.RED: 'red'>

3.12b4

>>> Color.__getattr__("RED")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: type object 'Color' has no attribute '__getattr__'. Did you mean: '__getitem__'?

I see that __getattr__ is documented, so I would have expected either a deprecation notice or an entry in What's New for Python 3.12.

Linked PRs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.12only security fixes3.13bugs and security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions