Commit 4d538fb5 authored by Stefan Behnel's avatar Stefan Behnel

add error test for 'await' in generator expressions

parent 09a61d2a
# mode: error
# tag: pep492, async
async def genexpr(it):
return (await x for x in it)
async def listcomp(it):
return [await x for x in it]
async def setcomp(it):
return {await x for x in it}
async def dictcomp(it):
return {await x:x+1 for x in it}
# NOTE: CPython doesn't allow comprehensions either
_ERRORS = """
5:12: 'await' not allowed in generators (use 'yield')
5:12: 'await' not supported here
"""
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment