mirror of
https://github.com/python/cpython.git
synced 2025-09-14 20:56:06 +00:00
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()
This commit is contained in:
parent
80acc3ebbc
commit
8fb307cd65
13 changed files with 343 additions and 69 deletions
|
@ -1,3 +1,2 @@
|
|||
async def foo():
|
||||
def foo(a:await something()):
|
||||
pass
|
||||
async def foo(a:await something()):
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue