Python 3.15 is introducing a new built-in immutable type called frozendict (FD). Unlike regular dicts, FD inherits directly from object (not dict), is hashable when keys and values are hashable, preserves insertion order but performs order-independent comparisons, and raises TypeError on item assignment. It supports the collections.abc.Mapping protocol for iteration, union operator for merging (always creating a new FD), shallow and deep copy, and straightforward type annotations. Many mutable dict methods are unavailable since FD is immutable. The feature is specified in PEP 814 and is not yet available as of Python 3.15 alpha 5.

4m watch time

Sort: