[Python-Dev] PEP 492 vs. PEP 3152, new round (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Sat Apr 25 06:39:37 CEST 2015


Guido van Rossum wrote:

Yury, could you tweak the syntax for await so that we can write the most common usages without parentheses? In particular I'd like to be able to write _ _return await foo()_ _with await foo() as bar: ..._ _foo(await bar(), await bletch())_ _

Making 'await' a prefix operator with the same precedence as unary minus would allow most reasonable usages, I think.

The only reason "yield from" has such a constrained syntax is that it starts with "yield", which is similarly constrained. Since 'await' is a brand new keyword isn't bound by those constraints.

-- Greg



More information about the Python-Dev mailing list