| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
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:
from ctypes import pythonapi, py_object, c_int
set_immortal = pythonapi.PyUnstable_SetImmortal
set_immortal.argtypes = (py_object,)
set_immortal.restype = c_int
print(set_immortal("Hello world"))
Sorry, something went wrong.
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
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).
Sorry, something went wrong.
I'd like to keep it aligned with PyObject_IsImmortal and avoid introducing the Object in between. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM!
Sorry, something went wrong.
|
Kumar also added PyUnstable_SetImmortal() function for Python 3.13 and 3.14 in pythoncapi-compat: python/pythoncapi-compat#164. |
Sorry, something went wrong.
…ts as immortal (python#144543)
…ts as immortal (python#144543)
…ts as immortal (python#144543)
| Back | FazBrowse Home | New Git URL |
📚 Documentation preview 📚: https://cpython-previews--144543.org.readthedocs.build/