Message150317
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? |
|
Date |
User |
Action |
Args |
2011-12-28 21:11:25 | eric.snow | set | recipients:
+ eric.snow, pitrou, Arfrever |
2011-12-28 21:11:24 | eric.snow | set | messageid: <1325106685.0.0.411832471872.issue13672@psf.upfronthosting.co.za> |
2011-12-28 21:11:24 | eric.snow | link | issue13672 messages |
2011-12-28 21:11:24 | eric.snow | create | |
|