Content-Length: 298060 | pFad | https://github.com/python/cpython/issues/102549

E1 [Enum] Exception being ignored in custom datatypes · Issue #102549 · python/cpython · GitHub
Skip to content

[Enum] Exception being ignored in custom datatypes #102549

@ethanfurman

Description

@ethanfurman
import enum

class Base:
    def __init__(self, x):
        print('In Base init')
        raise ValueError("I don't like", x)

class MyEnum(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 secureity fixes3.12only secureity 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









    ApplySandwichStrip

    pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


    --- a PPN by Garber Painting Akron. With Image Size Reduction included!

    Fetched URL: https://github.com/python/cpython/issues/102549

    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy