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

Yury Selivanov yselivanov.ml at gmail.com
Thu Apr 23 03:27:06 CEST 2015


Greg,

On 2015-04-22 7:47 PM, Greg Ewing wrote:
> Yury Selivanov wrote:
>
>> On the other hand, I hate the idea
>> of grammatically requiring parentheses for 'await'
>> expressions.  That feels non-pytonic to me.
>
> How is it any different from grammatically requiring
> parens in an ordinary function call? Nobody ever
> complained about that.

It is different.

1. Because 'await' keyword might be at a great distance
from the object you're really calling:

await foo.bar.baz['spam']()
   +-----------------------+

Can I chain the calls:

await foo()() ?

or await foo().bar()?

2. Because there is no other keyword in python
with similar behaviour.

3. Moreover: unless I can write 'await future' - your
proposal *won't* work with a lot of existing code
and patterns.  It's going to be radically different
from all other languages that implement 'await' too.

Yury


More information about the Python-Dev mailing list