-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
[Enum] Exception being ignored in custom datatypes #102549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Just tested this - 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(1) Output
What behaviour are you describing that's a bug? |
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 and
|
This was referenced Mar 31, 2023
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Mar 31, 2023
…_init__ (pythonGH-103149) (cherry picked from commit 2a4d8c0) Co-authored-by: Ethan Furman <[email protected]>
ethanfurman
added a commit
that referenced
this issue
Mar 31, 2023
miss-islington
added a commit
that referenced
this issue
Apr 3, 2023
GH-103149) (cherry picked from commit 2a4d8c0) Co-authored-by: Ethan Furman <[email protected]>
warsaw
pushed a commit
to warsaw/cpython
that referenced
this issue
Apr 11, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MyEnum
should not be created because of the exception inBase.__init__
.Linked PRs
The text was updated successfully, but these errors were encountered: