[Python-Dev] PEP 492 vs. PEP 3152, new round (original) (raw)
Greg Ewing greg.ewing at canterbury.ac.nz
Mon Apr 27 14:52:25 CEST 2015
- Previous message (by thread): [Python-Dev] PEP 492 vs. PEP 3152, new round
- Next message (by thread): [Python-Dev] PEP 492 vs. PEP 3152, new round
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Yury Selivanov wrote:
I've done some experiments with grammar, and it looks like we indeed can parse await quite differently from yield. Three different options:
You don't seem to have tried what I suggested, which is to make 'await' a unary operator with the same precedence as '-', i.e. replace
factor: ('+'|'-'|'~') factor | power
with
factor: ('+'|'-'|'~'|'await') factor | power
That would allow
await a() res = await a() + await b() res = await await a() if await a(): pass return await a() print(await a()) func(arg=await a()) await a() * b()
-- Greg
- Previous message (by thread): [Python-Dev] PEP 492 vs. PEP 3152, new round
- Next message (by thread): [Python-Dev] PEP 492 vs. PEP 3152, new round
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]