This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.snow
Recipients Arfrever, eric.snow, pitrou
Date 2011-12-28.21:11:24
SpamBayes Score 1.0406326e-05
Marked as misclassified No
Message-id <1325106685.0.0.411832471872.issue13672@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2011-12-28 21:11:25eric.snowsetrecipients: + eric.snow, pitrou, Arfrever
2011-12-28 21:11:24eric.snowsetmessageid: <1325106685.0.0.411832471872.issue13672@psf.upfronthosting.co.za>
2011-12-28 21:11:24eric.snowlinkissue13672 messages
2011-12-28 21:11:24eric.snowcreate