Author mbussonn
Recipients BTaskaya, asvetlov, hroncok, jack1142, lukasz.langa, mbussonn, miss-islington, pablogsal, serhiy.storchaka, vstinner
Date 2020-07-06.15:05:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1594047955.83.0.205840982184.issue39562@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-07-06 15:05:55mbussonnsetrecipients: + mbussonn, vstinner, asvetlov, lukasz.langa, serhiy.storchaka, hroncok, pablogsal, miss-islington, BTaskaya, jack1142
2020-07-06 15:05:55mbussonnsetmessageid: <1594047955.83.0.205840982184.issue39562@roundup.psfhosted.org>
2020-07-06 15:05:55mbussonnlinkissue39562 messages
2020-07-06 15:05:55mbussonncreate