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 Gabriele Tornetta
Recipients Gabriele Tornetta, Mark.Shannon, pablogsal
Date 2021-06-29.20:16:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1624997784.35.0.709432212946.issue44530@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2021-06-29 20:16:24Gabriele Tornettasetrecipients: + Gabriele Tornetta, Mark.Shannon, pablogsal
2021-06-29 20:16:24Gabriele Tornettasetmessageid: <1624997784.35.0.709432212946.issue44530@roundup.psfhosted.org>
2021-06-29 20:16:24Gabriele Tornettalinkissue44530 messages
2021-06-29 20:16:24Gabriele Tornettacreate