I have 2 related proposals:
1. Give generators a .__name__ attribute that is the same as their curent
(3.0a5) .gi_code.co_name subattribute. just as funct.__name__ is
func.__code__.co_name.
My reason is, I expect, much the same as that for func.__name__. I am
using the generator name (for bad-iterator-output messages in a test
function) and would prefer to get it through a cross-implementation
'public' interface' rather than a cPython internal implementation detail
(which I understand code object to be). I am otherwise trying to avoid
using cPython internals.
(Is there any plan to change the gi_* attributes the way the func_*
attributes were?)
2. Whether or not 1 is adopted, add the name to the representation:
<gfuncname generator object as..> or