gh-127949: remove asyncio policy system#150310
Open
kumaraditya303 wants to merge 6 commits into
Open
Conversation
7 tasks
Documentation build overview
160 files changed ·
|
90729cb to
68b9948
Compare
|
🤖 New build scheduled with the buildbot fleet by @kumaraditya303 for commit 5db128f 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F150310%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
hugovk
reviewed
Jun 23, 2026
Comment on lines
-33
to
-56
| * :mod:`asyncio` policy system is deprecated and will be removed in Python 3.16. | ||
| In particular, the following classes and functions are deprecated: | ||
|
|
||
| * :class:`asyncio.AbstractEventLoopPolicy` | ||
| * :class:`asyncio.DefaultEventLoopPolicy` | ||
| * :class:`asyncio.WindowsSelectorEventLoopPolicy` | ||
| * :class:`asyncio.WindowsProactorEventLoopPolicy` | ||
| * :func:`asyncio.get_event_loop_policy` | ||
| * :func:`asyncio.set_event_loop_policy` | ||
|
|
||
| Users should use :func:`asyncio.run` or :class:`asyncio.Runner` with | ||
| *loop_factory* to use the desired event loop implementation. | ||
|
|
||
| For example, to use :class:`asyncio.SelectorEventLoop` on Windows:: | ||
|
|
||
| import asyncio | ||
|
|
||
| async def main(): | ||
| ... | ||
|
|
||
| asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop) | ||
|
|
||
| (Contributed by Kumar Aditya in :gh:`127949`.) | ||
|
|
Member
There was a problem hiding this comment.
Please keep this here.
This file is included in the older What's New pages, for example:
- https://docs.python.org/3.16/whatsnew/3.14.html#pending-removal-in-python-3-16
- https://docs.python.org/3.16/whatsnew/3.15.html#pending-removal-in-python-3-16
But it's not included in 3.16's own pages:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.