Skip to content

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

Merged
1st1 merged 1 commit intopython:masterfrom
1st1:running
Dec 11, 2017
Merged

bpo-32269: Add asyncio.get_running_loop().#4782
1st1 merged 1 commit intopython:masterfrom
1st1:running

Conversation

@1st1
Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@1st1
Copy link
Copy Markdown
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
Copy Markdown
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