Ivan Levkivskyi added the comment:
Yury, thank you for the patch, the error message is much clearer now.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24528
___
Roundup Robot added the comment:
New changeset 30b676e8b21f by Yury Selivanov in branch '3.5':
Issue #24528: Improve error message for awaits in comprehensions
https://hg.python.org/cpython/rev/30b676e8b21f
New changeset 9598bc916186 by Yury Selivanov in branch 'default':
Merge 3.5 (Issue
Changes by Yury Selivanov yseliva...@gmail.com:
--
resolution: - fixed
stage: patch review - resolved
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24528
___
Changes by Yury Selivanov yseliva...@gmail.com:
--
assignee: - yselivanov
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue24528
___
___
New submission from Ivan Levkivskyi:
The following code:
async def foo():
lst = [await coro(i) for i in range(10)]
return lst
gives
SyntaxError: 'await' outside async function
I understand that this is because the comprehensions are implemented using a
function scope (see also
Yury Selivanov added the comment:
Thanks for discovering this, Ivan. The patch is attached.
--
keywords: +needs review, patch
nosy: +ncoghlan
stage: - patch review
Added file: http://bugs.python.org/file39834/awaitcomp.patch
___
Python tracker