Immortal Objects: Key Types & Memory Gains

Python 3.12 introduced Immortal Objects (PEP 683) for high-use singletons like `None`, `True`, and `False`. These objects now have a fixed reference count, bypassing frequent checks and living for the interpreter's lifetime. This change reduces CPU cache invalidation and significantly decreases private memory usage in multi-process deployments by avoiding copy-on-write issues.

Sources

Open the full topic