Eric Snow <ericsnowcurren...@gmail.com> added the comment:

True.  I wonder, though if perhaps a co_func (as a weak ref) or co_orig_func 
would be better, since co_qualname would be built from the original function 
anyway.  Then you could call "code.co_func.func_qualname".

One sticky point is that there isn't a guarantee of one-to-one between function 
object and code object.  A code object could be bound to several different 
functions as happens with function definitions (particularly lambdas) inside 
comprehensions.

Also, if a code object is not associated with a function, i.e. one generated by 
exec, what should the qualname for the code object be?  How about, in CPython, 
the code objects created for classes and modules?

----------

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

Reply via email to