[issue33346] Syntax error with async generator inside dictionary comprehension

Yury Selivanov report at bugs.python.org
Mon May 14 17:28:58 EDT 2018


Yury Selivanov <yselivanov at gmail.com> added the comment:

> Did you mean {} for the outer brackets intead of []?

Yes, my bad.

> All of these should only be allowed inside 'async def' though, right?

Yep, except async generator expressions which are allowed to appear in synchronous contexts, e.g.:

   def foo():
       return (i async for i in ai)

(this already works in 3.7).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33346>
_______________________________________


More information about the Python-bugs-list mailing list