From a051862df6b9e82c138ed6a0838e82fdc09f9a46 Mon Sep 17 00:00:00 2001 From: oedokumaci Date: Mon, 25 May 2026 16:26:52 +0200 Subject: [PATCH 1/2] gh-150403: Document `frozendict` in language reference Mappings section --- Doc/reference/datamodel.rst | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index aef5bbe151cfeba..ac4b05bca624888 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -496,7 +496,7 @@ subscript notation ``a[k]`` selects the item indexed by ``k`` from the mapping :keyword:`del` statements. The built-in function :func:`len` returns the number of items in a mapping. -There is currently a single intrinsic mapping type: +There are currently two intrinsic mapping types: Dictionaries @@ -535,6 +535,20 @@ module. an implementation detail at that time rather than a language guarantee. +Frozen dictionaries +^^^^^^^^^^^^^^^^^^^ + +.. index:: pair: object; frozendict + +These represent an immutable dictionary. They are created by the built-in +:func:`frozendict` constructor. A frozendict is :term:`hashable` if all of +its keys and values are hashable, in which case it can be used as an element +of a set, or as a key in another mapping. :class:`!frozendict` is not a +subclass of :class:`dict`; it inherits directly from :class:`object`. + +.. versionadded:: 3.15 + + Callable types -------------- From 125298f312e1fb43ab5fca52b8bf96e8abe3b02f Mon Sep 17 00:00:00 2001 From: oedokumaci Date: Mon, 25 May 2026 21:35:38 +0200 Subject: [PATCH 2/2] Drop redundant 'currently' per review --- Doc/reference/datamodel.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index ac4b05bca624888..e13b2c9db490a14 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -496,7 +496,7 @@ subscript notation ``a[k]`` selects the item indexed by ``k`` from the mapping :keyword:`del` statements. The built-in function :func:`len` returns the number of items in a mapping. -There are currently two intrinsic mapping types: +There are two intrinsic mapping types: Dictionaries