all AI news
Understanding Immortal Objects in Python 3.12
Simon Willison's Weblog simonwillison.net
Understanding Immortal Objects in Python 3.12
Abhinav Upadhyay provides a clear and detailed explanation of immortal objects coming in Python 3.12, which ensure Python no-longer updates reference counts for immutable objects such as True, False, None and low-values integers. The trick (which maintains ABI compatibility) is pretty simple: a reference count value of 4294967295 now means an object is immortal, and the existing Py_INCREF and Py_DECREF macros have been updated to take that into account.
clear count false low objects python python 3 reference simple true understanding updates value values