]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-150403: Document frozendict in language reference Mappings section (GH-150404)
authorOral Ersoy Dokumacı <oral.ersoy.dokumaci@gmail.com>
Fri, 29 May 2026 19:40:22 +0000 (21:40 +0200)
committerGitHub <noreply@github.com>
Fri, 29 May 2026 19:40:22 +0000 (22:40 +0300)
Doc/reference/datamodel.rst

index aef5bbe151cfebad6e95bd2117df61b6ea7795b2..e13b2c9db490a14c43f86a6abbc793bc929f87fb 100644 (file)
@@ -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 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
 --------------