pep-0492: Add invalid syntax examples; fix typo.

This commit is contained in:
Yury Selivanov 2015-04-29 12:09:19 -04:00
parent 50587d4184
commit 51329f953d
1 changed files with 12 additions and 2 deletions

View File

@ -171,7 +171,7 @@ Syntax of "await" expression
from``. The main difference is that *await expressions* do not require
parentheses around them most of the times.
Examples:
Valid syntax examples:
================================== ==================================
Expression Will be parsed as
@ -187,6 +187,16 @@ Expression Will be parsed as
``await foo() + await bar()`` ``(await foo()) + (await bar())``
================================== ==================================
Invalid syntax examples:
================================== ==================================
Expression Should be written as
================================== ==================================
``await await coro()`` ``await (await coro())``
``await -coro()`` ``await (-coro())``
================================== ==================================
See `Grammar Updates`_ section for details.
@ -718,7 +728,7 @@ to a more readable form::
async def foo(): # 2
return (await fut)
This limitation will go away as soon as ``async`` and ``await`` ate
This limitation will go away as soon as ``async`` and ``await`` are
proper keywords. Or if it's decided to use a future import for this
PEP.