SIGN IN SIGN UP
python / cpython UNCLAIMED

The Python programming language

0 0 0 Python

Issue #24619: New approach for tokenizing async/await.

This commit fixes how one-line async-defs and defs are tracked
by tokenizer.  It allows to correctly parse invalid code such
as:

>>> async def f():
...     def g(): pass
...     async = 10

and valid code such as:

>>> async def f():
...     async def g(): pass
...     await z

As a consequence, is is now possible to have one-line
'async def foo(): await ..' functions:

>>> async def foo(): return await bar()
Y
Yury Selivanov committed
8fb307cd650511ba019c4493275cb6684ad308bc
Parent: 80acc3e