You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUILD_INTERPOLATION and BUILD_TEMPLATE perform unnecessary refcount operations #145860
BUILD_INTERPOLATION and BUILD_TEMPLATE call _PyInterpolation_Build and _PyTemplate_Build respectively, and then decref their arguments. All other BUILD instructions call a "steal" function, to avoid the unnecessary incref then decref. BUILD_INTERPOLATION and BUILD_TEMPLATE should do the same.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
I understand the goal is to optimize BUILD_INTERPOLATION and BUILD_TEMPLATE by using "steal" functions to avoid the unnecessary incref and decref operations, bringing them in line with how other BUILD instructions handle their arguments.
Could you please assign this issue to me, or let me know if it's okay for me to just go ahead and open a PR? Thanks
Activity
akanil18 commentedon Mar 13, 2026
Hi I would love to work on this issue.
I understand the goal is to optimize
BUILD_INTERPOLATIONandBUILD_TEMPLATEby using "steal" functions to avoid the unnecessary incref and decref operations, bringing them in line with how otherBUILDinstructions handle their arguments.Could you please assign this issue to me, or let me know if it's okay for me to just go ahead and open a PR? Thanks
sergey-miryanov commentedon Mar 14, 2026
I would suggest you wait answer from Mark before start doing this.
pythongh-145860: Eliminate unnecessary refcount ops in BUILD_INTERPOL…
pythongh-145860: Document steal semantics in header declarations
Merge branch 'main' into pythongh-145860-build-interpolation-steal-refs
pythongh-145860: Add the Steal suffix to _PyInterpolation_Build and _…