PEP 814 has been accepted to introduce a built-in frozendict type in Python 3.15, implemented in C for performance. Unlike the existing types.MappingProxyType, frozendict is hashable if all its values are hashable, enabling its use in sets and as dictionary keys.
Background
Previous attempts to add immutable dictionaries, such as PEP 416 in 2012 and discussions around PEP 603, were either rejected or focused on different implementations like HAMT-based frozenmap.
- Source
- Lobsters
- Published
- Jul 5, 2026 at 02:52 PM
- Score
- 8.0 / 10