Matthias Bussonnier <bussonniermatth...@gmail.com> added the comment:

This make non-await list comprehension coroutine-code-objects as well: 

https://bugs.python.org/issue41218

    import ast
    import inspect
    cell = '[x for x in l]'
    code = compile(cell, "<>", "exec", 
flags=getattr(ast,'PyCF_ALLOW_TOP_LEVEL_AWAIT', 0x0))

    inspect.CO_COROUTINE & code.co_flags == inspect.CO_COROUTINE  # this is now 
TRUE. 

This leads to weird things in Jupyter/IPython when we try to detect wether a 
block of code is, or os not async.

----------
nosy: +mbussonn

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39562>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to