← 返回首页
gh-94597: deprecate asyncio.set_event_loop_policy by graingert · Pull Request #110728 · python/cpython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

gh-94597: deprecate asyncio.set_event_loop_policy#110728

Closed
graingert wants to merge 15 commits into
python:mainfrom
graingert:deprecate-set-event-loop-policy
Closed

gh-94597: deprecate asyncio.set_event_loop_policy#110728
graingert wants to merge 15 commits into
python:mainfrom
graingert:deprecate-set-event-loop-policy

Conversation

graingert commented Oct 11, 2023
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

graingert changed the title deprecate asyncio.set_event_loop_policy gh-94597: deprecate asyncio.set_event_loop_policy Oct 11, 2023
graingert force-pushed the deprecate-set-event-loop-policy branch 4 times, most recently from a7fe31c to 339445e Compare October 11, 2023 17:18

cjw296 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

No objection to the unittest or AsyncMock changes!

JelleZijlstra removed their request for review October 12, 2023 02:18
rhettinger removed their request for review October 16, 2023 03:47

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Just a few nits, basically LG. That tearDownModule() pattern is annoying! :-)

I assume that deprecating get_event_loop_policy() will follow? Are there other APIs? I'm guessing we also want to avoid instantiating or subclassing the standard event loop policy classes (I expect this will turn up some significant uses of them).

Before we merge this we may need to bring this up on discuss.python.org (in the asyncio category) to see if there are significant objections to the proposed deprecation schedule.

Comment thread Doc/library/asyncio-policy.rst Outdated Show resolved Hide resolved
Comment thread Lib/asyncio/events.py Outdated Show resolved Hide resolved
Comment thread Lib/test/test_asyncio/test_events.py Outdated Show resolved Hide resolved
Comment thread Misc/NEWS.d/next/Library/2023-10-11-15-55-53.gh-issue-94597.qXo8Q4.rst Outdated Show resolved Hide resolved
…o8Q4.rst Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>

graingert commented Oct 26, 2023
edited
Loading

Copy link
Copy Markdown
Contributor Author

Just a few nits, basically LG. That tearDownModule() pattern is annoying! :-)

I think we can start getting rid of those tearDownModules using #110774

I assume that deprecating get_event_loop_policy() will follow? Are there other APIs? I'm guessing we also want to avoid instantiating or subclassing the standard event loop policy classes (I expect this will turn up some significant uses of them).

Yep currently that's a bit more complicated because get/set_event_loop calls get_event_loop_policy and afaik we don't want to make get_event_loop an alias of get_running_loop anymore

9 hidden items Load more…
Comment thread Doc/whatsnew/3.13.rst Outdated Show resolved Hide resolved
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>

Copy link
Copy Markdown
Contributor Author

Before we merge this we may need to bring this up on discuss.python.org (in the asyncio category) to see if there are significant objections to the proposed deprecation schedule.

discuss post posted here: https://discuss.python.org/t/removing-the-asyncio-policy-system-asyncio-set-event-loop-policy-in-python-3-15/37553

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Okay, I'm happy with this. Let's wait a bit if anyone brings up substantial objections in the Discourse thread.

willingc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Bravo @graingert for simplifying. ✨

kumaraditya303 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Please also add a notice under asyncio changes, most users like myself won't look under 3.15 removals for this change. Thanks

bedevere-app Bot commented Nov 1, 2023

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be poked with soft cushions!

Copy link
Copy Markdown
Contributor Author

Please also add a notice under asyncio changes, most users like myself won't look under 3.15 removals for this change. Thanks

Can you link me to the location in the docs that you mean please?

kumaraditya303 commented Nov 1, 2023
edited
Loading

Copy link
Copy Markdown
Contributor

Can you link me to the location in the docs that you mean please?

Add asyncio entry in https://docs.python.org/3.13/whatsnew/3.13.html#deprecated

hugovk commented Nov 1, 2023

Copy link
Copy Markdown
Member

That sounds fine, then let's move it from the "Pending Removal in Python 3.15" section to this one.

Copy link
Copy Markdown
Contributor Author

I have made the requested changes; please review again

gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

LGTM, but let's wait until the dust in the Discourse thread settles.

1st1 commented Sep 12, 2024

Copy link
Copy Markdown
Member

Happy to review and hopefully merge this during the core sprint.

hugovk added the sprint label Sep 12, 2024
graingert closed this Dec 25, 2024
graingert deleted the deprecate-set-event-loop-policy branch December 25, 2024 08:05

graingert commented Dec 25, 2024
edited
Loading

Copy link
Copy Markdown
Contributor Author

@kumaraditya303 is doing this now in gh-127949

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

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

8 participants

Footer

© 2026 GitHub, Inc.