New submission from Jonathan Crall <erote...@gmail.com>:

I first noticed this when testing xdoctest on Python 3.9, and then again when 
using IPython.

I was finally able to generate a minimal working example in Python itself. The 
following code:

python -c "print(eval(compile('[i for i in range(3)]', mode='eval', 
filename='foo', flags=221184)))"

produces 

[0, 1, 2]
 
in Python <= 3.8, but in 3.9 it produces: 

<coroutine object <module> at 0x7fa336d40ec0>
<string>:1: RuntimeWarning: coroutine '<module>' was never awaited
RuntimeWarning: Enable tracemalloc to get the object allocation traceback


Is this an intended change? I can't find any notes in the CHANGELOG that seem 
to correspond to it.

----------
components: Interpreter Core
messages: 367651
nosy: Jonathan Crall
priority: normal
severity: normal
status: open
title: Python 3.9 eval on list comprehension sometimes returns coroutines
versions: Python 3.9

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

Reply via email to