Author yselivanov
Recipients asvetlov, yselivanov
Date 2017-12-10.17:08:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1512925724.74.0.213398074469.issue32269@psf.upfronthosting.co.za>
In-reply-to
Content
In many contexts `asyncio._get_running_loop()` is more useful than `asyncio.get_event_loop()`.  The former function is predictable and simple, the latter can change its behaviour depending on the current policy and can even create new event loops.

Both `asyncio._get_running_loop()` and `asyncio._set_running_loop()` are public asyncio API, although the leading underscore suggests that they are special and shouldn't be used by regular users.  That's true for `asyncio._set_running_loop()`, which is intended to be used by event loops exclusively.

I propose to remove the leading underscore from `asyncio._get_running_loop()`, making it `asyncio.get_running_loop()`, and thus promoting a safer alternative to `asyncio.get_event_loop()`.

`asyncio._get_running_loop()` will be deprecated and removed in Python 3.9.
History
Date User Action Args
2017-12-10 17:08:44yselivanovsetrecipients: + yselivanov, asvetlov
2017-12-10 17:08:44yselivanovsetmessageid: <1512925724.74.0.213398074469.issue32269@psf.upfronthosting.co.za>
2017-12-10 17:08:44yselivanovlinkissue32269 messages
2017-12-10 17:08:44yselivanovcreate