[issue32469] Generator and coroutine repr could be more helpful

Antoine Pitrou report at bugs.python.org
Sun Dec 31 14:53:29 EST 2017


New submission from Antoine Pitrou <pitrou at free.fr>:

Currently, a generator or coroutine's repr looks like this:

>>> gen
<coroutine object f at 0x7f86c9733790>

It could instead be something like:

>>> gen
<coroutine at 0x7f86c9733790, suspended, file "/home/antoine/cpython/default/Lib/logging/__init__.py", line 123, code getLogger>

(replace "suspended" with "running" or "closed" depending on the generator's status -- i.e. gi_running and gi_frame attributes)

----------
messages: 309302
nosy: benjamin.peterson, pitrou, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Generator and coroutine repr could be more helpful
versions: Python 3.7

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


More information about the Python-bugs-list mailing list