On 26 April 2015 at 06:18, Yury Selivanov <yselivanov.ml at gmail.com> wrote: > Option #3. Create a new terminal for await expression between > 'atom' and 'power'. > > Required grammar changes: > https://gist.github.com/1st1/cb0bd257b04adb87e167#file-option-3-patch > > Repo to play with (parser module is broken atm): > https://github.com/1st1/cpython/tree/await_noparens2 > > Syntax: > > await a() > res = await a() + await b() > res = await (await a()) # invalid syntax w/o parens > if await a(): pass > return await a() > print(await a()) > func(arg=await a()) > await (a() * b()) # w/o parens '(await a() * b()) > > I think that Option #3 is a clear winner. Very nice! How would the following statements parse with this option? res = await a(), b() res = [await a(), b()] with await a(), b: pass f(await a(), b) I think it's OK if these end up requiring parentheses in order to do the right thing (as that will be helpful for humans regardless), but the PEP should be clear as to whether or not they do: res = (await a()), b() res = [(await a()), b()] with (await a()), b: pass f((await a()), b) Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4