Skip to content
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

bpo-32269: Add asyncio.get_running_loop(). #4782

Merged
merged 1 commit into from
Dec 11, 2017
Merged

Conversation

1st1
Copy link
Member

@1st1 1st1 commented Dec 10, 2017

@1st1 1st1 requested a review from asvetlov December 10, 2017 17:31
@1st1 1st1 changed the title Add asyncio.get_running_loop(). bpo-32269: Add asyncio.get_running_loop(). Dec 10, 2017
@asvetlov
Copy link
Contributor

Is _get_running_loop() a public or it is actually an implementation detail.
I thought the second sentence is right.

@1st1
Copy link
Member Author

1st1 commented Dec 11, 2017

_get_running_loop() is a part of the API intended to be used by alternative event loops like uvloop and frameworks like Twisted. When we added it we decided to keep it undocumented, but export it as part of asyncio.__all__.

I've reconsidered removing the function -- let's keep it as it.

I've changed the proposed get_running_loop() to raise a RuntimeError if there's no running event loop.

Copy link
Contributor

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

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

Perfect!

@1st1 1st1 merged commit abae67e into python:master Dec 11, 2017
@1st1 1st1 deleted the running branch December 11, 2017 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants