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
[3.11] gh-100160: Remove any deprecation warnings in asyncio.get_event_loop() #100412
base: 3.11
Are you sure you want to change the base?
[3.11] gh-100160: Remove any deprecation warnings in asyncio.get_event_loop() #100412
Conversation
…_loop() They are deferred to Python 3.12.
Doc/library/asyncio-eventloop.rst
Outdated
.. deprecated:: 3.10 | ||
Deprecation warning is emitted if there is no current event loop. | ||
In Python 3.12 it will be an error. | ||
|
||
.. note:: | ||
In Python versions 3.10.0--3.10.8 and 3.11.0 this function | ||
(and other functions which used it implicitly) emitted a | ||
:exc:`DeprecationWarning` if there was no running event loop, even if | ||
the current loop was set. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the stormy history of deprecations here, maybe add a note indicating which versions emit deprecation warnings under which circumstances? I think it might be:
- 3.10.0-3.10.8, 3.11.0: warn if there is no running event loop
- 3.10.9, 3.11.1: warn if there's no running AND no current event loop
- 3.10.10+, 3.11.2+: no warning, may create new loop OR raise RuntimeError if there's no running and no current loop
- 3.12, 3.13: warning if it creates a new loop
- 3.14: error instead of creating a new loop
(Am I right about all that?)
Also in the next file.
Thank you for your review Guido. I switched it to draft to be sure that it will not be accidentally merged. The hard part in these PRs (#100410 and #100412) is documentation. It is difficult to find good place where all this mess should be documented, and I am bad in writing English. I think that non-documentation part is ready, but I am not sure about the documentation. Fill free to commit directly to this branch or create a new PR based on it. |
They are deferred to Python 3.12.