[Python-Dev] async/await in Python; v2

Guido van Rossum guido at python.org
Wed Apr 22 17:50:56 CEST 2015


On Wed, Apr 22, 2015 at 8:40 AM, Yury Selivanov <yselivanov.ml at gmail.com>
wrote:
>
> On the one hand I like your idea to disallow calling
> coroutines without a special keyword (await in case of
> PEP 492).  It has downsides, but there is some
> elegance in it.  On the other hand, I hate the idea
> of grammatically requiring parentheses for 'await'
> expressions.  That feels non-pytonic to me.
>
> I'd be happy to hear others opinion on this topic.
>

I'm slowly warming up to Greg's notion that you can't call a coroutine (or
whatever it's called) without a special keyword. This makes a whole class
of bugs obvious the moment the code is executed.

OTOH I'm still struggling with what you have to do to wrap a coroutine in a
Task, the way its done in asyncio by the Task() constructor, the
loop.create_task() method, and the async() function (perhaps to be renamed
to ensure_task() to make way for the async keyword).

-- 
--Guido van Rossum (python.org/~guido)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20150422/acac7a72/attachment.html>


More information about the Python-Dev mailing list