Skip to content

[Enum] Exception being ignored in custom datatypes #102549

Description

@ethanfurman
importenumclassBase:
def__init__(self, x):
print('In Base init')
raiseValueError("I don't like", x)
classMyEnum(Base, enum.Enum):
A='a'def__init__(self, y):
print('In MyEnum init')
self.y=y

MyEnum should not be created because of the exception in Base.__init__.

Linked PRs

Metadata

Metadata

Assignees

Labels

3.11only security fixes3.12only security fixesstdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions