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
sys.set_asyncgen_hooks with invalid firstiter may partially set finalizer #118473
Labels
type-bug
An unexpected behavior, bug, or error
Comments
youknowone
added a commit
to youknowone/cpython
that referenced
this issue
May 1, 2024
youknowone
added a commit
to youknowone/cpython
that referenced
this issue
May 1, 2024
youknowone
added a commit
to youknowone/cpython
that referenced
this issue
May 1, 2024
youknowone
added a commit
to youknowone/cpython
that referenced
this issue
May 1, 2024
SonicField
pushed a commit
to SonicField/cpython
that referenced
this issue
May 8, 2024
…arguments are invalid (python#118474)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug report
Bug description:
PEP 525 doesn't imply or define partial initialization priority. Since inside of
set_asyncgen_hooks
is blackbox to user, this is surprising and users are hard to know they have to back up current setup and recover it whenTypeError
happens.Inconsistency also cause user experience problem. Current order
sys.set_asyncgen_hooks(firstiter="invalid", finalizer=finalizer)
causes partial set, butsys.set_asyncgen_hooks(firstiter=finalizer, finalizer="invalid")
will not.CPython versions tested on:
CPython main branch
Operating systems tested on:
macOS
Linked PRs
The text was updated successfully, but these errors were encountered: