Uh oh!
There was an error while loading. Please reload this page.
gh-143300: implement PyUnstable_SetImmortal - #144543
Conversation
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
ZeroIntensity
left a comment
There was a problem hiding this comment.
I think we also need to document the guarantees regarding which objects may be made immortal. For example, the following results in an assertion failure:
fromctypesimportpythonapi, py_object, c_intset_immortal=pythonapi.PyUnstable_SetImmortalset_immortal.argtypes= (py_object,)
set_immortal.restype=c_intprint(set_immortal("Hello world"))Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
ZeroIntensity
left a comment
There was a problem hiding this comment.
Looks pretty good.
Bikeshedding: Should this be named PyUnstable_Object_SetImmortal? The Py[Unstable]_ prefix is generally reserved for runtime operations (though it seems PyUnstable_TryIncRef didn't follow that rule).
Uh oh!
There was an error while loading. Please reload this page.
kumaraditya303
commented
Feb 10, 2026
I'd like to keep it aligned with |
Uh oh!
There was an error while loading. Please reload this page.
9d262b1 to
a146befComparevstinner
commented
Feb 12, 2026
Kumar also added |
📚 Documentation preview 📚: https://cpython-previews--144543.org.readthedocs.build/