Gabriele N Tornetta <phoenix1...@gmail.com> added the comment:

Thanks for the feedback. I certainly appreciate all the concerns around this 
proposed change.

@Mark.Shannon

1. This is the desired behaviour as profiling data should be attached to the 
actual code objects that correlate with the actual source content. Besides, in 
this respect, given the immutability of code objects, qualname behaves like 
name.

2. At the Python level it is already possible to get the __qualname__ of a 
function (but not of a code object). As this is all I needed, I kept my initial 
implementation to the bare minimum.

3. I agree with this analysis. Whilst this increases the memory footprint, it 
might have the benefit of making the derivation of __qualname__ faster as this 
would now be cached on code objects.

However, I also appreciate @pablogsal's point of view of evaluating the actual 
benefits. The extra point in favour of this change that I can make is that it 
would resolve name clashes in profiling data from tools that have minimal 
impact on the runtime. Whether this is enough to justify the extra memory cost 
is certainly up for debate. From my side, I don't have the numbers to make this 
case more concrete.

As a next step, I'll look into exposing the new field to Python to see what it 
actually ends up looking like.

----------

_______________________________________
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