From 97de150fd93a4921cd5d4bd81110420095c8ce29 Mon Sep 17 00:00:00 2001 From: Yury Selivanov Date: Thu, 23 Jul 2015 15:01:58 +0300 Subject: Issue #24619: Simplify async/await tokenization. This commit simplifies async/await tokenization in tokenizer.c, tokenize.py & lib2to3/tokenize.py. Previous solution was to keep a stack of async-def & def blocks, whereas the new approach is just to remember position of the outermost async-def block. This change won't bring any parsing performance improvements, but it makes the code much easier to read and validate. --- Lib/test/test_coroutines.py | 1 + 1 file changed, 1 insertion(+) (limited to 'Lib/test/test_coroutines.py') diff --git a/Lib/test/test_coroutines.py b/Lib/test/test_coroutines.py index 14682ca604..10de85644e 100644 --- a/Lib/test/test_coroutines.py +++ b/Lib/test/test_coroutines.py @@ -330,6 +330,7 @@ class AsyncBadSyntaxTest(unittest.TestCase): async def f(): async def g(): pass await z + await = 1 self.assertTrue(inspect.iscoroutinefunction(f)) -- cgit v1.2.1