[issue24056] Expose closure & generator status in function repr()

Serhiy Storchaka report at bugs.python.org
Fri May 22 20:39:12 CEST 2015


Serhiy Storchaka added the comment:

I like the look of the repr Terry proposes better. For generator objects the repr is either "<coroutine object %S at %p>" or "<generator object %S at %p>". "<coroutine function %S at %p>" and "<generator function %S at %p>" would be consistent with this. It also shows the relation and the difference between the generator function and the generator object.

Yet one argument is that both terms "generator object" and "generator function" are searchable in the documentation.

There are other precedences with exposing flags at the start of the repr. "<built-in function %s>" and "<built-in method %s of %s object at %p>", "<unlocked %s object at %p>" and "<locked %s object at %p>".

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24056>
_______________________________________


More information about the Python-bugs-list mailing list