-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
TypeError
when raising an exception inside the __init__
method of an enum class
#125259
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
1 task
ethanfurman
pushed a commit
that referenced
this issue
Oct 22, 2024
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Oct 22, 2024
…onGH-125647) (cherry picked from commit 34653bb) Co-authored-by: Mario Šaško <[email protected]>
ethanfurman
pushed a commit
that referenced
this issue
Oct 25, 2024
ethanfurman
pushed a commit
to ethanfurman/cpython
that referenced
this issue
Oct 25, 2024
…onGH-125647) (cherry picked from commit 34653bb)
ethanfurman
added a commit
that referenced
this issue
Oct 25, 2024
…125647) (GH-125953) (cherry picked from commit 34653bb) Co-authored-by: Mario Šaško <[email protected]>
ebonnal
pushed a commit
to ebonnal/cpython
that referenced
this issue
Jan 12, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Bug description:
With #111815, any exception raised inside the
__init__
method of an enum class 1 is expected to be:ValidationError
s, see Python 3.12 Enum Class Validated Initialization TypeError pydantic/pydantic#10593)cpython/Lib/enum.py
Lines 556 to 566 in 120b891
Meaning the following raises a
TypeError
instead of the expectedMyValueError
:CPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs
Footnotes
An example is documented as an example here. ↩
The text was updated successfully, but these errors were encountered: