[Async-sig] Inadvertent layering of synchronous code as frameworks adopt asyncio

Glyph glyph at twistedmatrix.com
Wed Mar 27 01:06:22 EDT 2019


> On Mar 26, 2019, at 11:36 AM, Guido van Rossum <guido at python.org> wrote:
> 
> Maybe running two *independent* loops should just always be allowed? As was said, it should be no worse than calling requests.get(). There currently is an explicit check against this -- deleting that check seems to make this work, as long as you close the nested loop explicitly. (This may be something that we should fix too, I don't have time to look into it right now.)
> 
> Are there use cases in Jupyter that wouldn't be satisfied by using a *different* event loop?


Agreed - with the one caveat that perhaps run_until_complete specifically should complain unless you say 'reentrantly=True', just to give people who may not even realize that Jupyter (or whatever other host environment, this isn't really jupyter-specific!) is already running an event loop that they should at least try 'await'-ing first before spinning up a blocking sub-loop.

-g

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/async-sig/attachments/20190326/92f1b68f/attachment-0001.html>


More information about the Async-sig mailing list