Mark Shannon <m...@hotpy.org> added the comment:

I think this is a worthwhile improvement.
A few comments on this issue and your PR.

1. We already have qualified names on functions and generators and those can be 
modified by @decorators.
In those cases, the code object and the function would disagree.
Code objects are immutable, so any thoughts on the usability implications of 
qualname differing between code object and function?

2. If we are adding a new attribute, it should be at the Python level. The 
internal layout of the code object is likely to change. (I have no problem with 
it being visible to tools like austin, just it won't be part of the API.)

3. As it stands, this is beneficial to only a small set of tools, but has a 
negative impact on memory use.
If we were to leverage the new field to improve the performance of function 
creation (important for closures) by omitting the qualname (and defaulting to 
the code object's) then it would benefit everyone.

----------
nosy: +Mark.Shannon

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

Reply via email to