Skip to content

Commit a051862

Browse files
committed
gh-150403: Document frozendict in language reference Mappings section
1 parent a189e3d commit a051862

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

Doc/reference/datamodel.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ subscript notation ``a[k]`` selects the item indexed by ``k`` from the mapping
496496
:keyword:`del` statements. The built-in function :func:`len` returns the number
497497
of items in a mapping.
498498

499-
There is currently a single intrinsic mapping type:
499+
There are currently two intrinsic mapping types:
500500

501501

502502
Dictionaries
@@ -535,6 +535,20 @@ module.
535535
an implementation detail at that time rather than a language guarantee.
536536

537537

538+
Frozen dictionaries
539+
^^^^^^^^^^^^^^^^^^^
540+
541+
.. index:: pair: object; frozendict
542+
543+
These represent an immutable dictionary. They are created by the built-in
544+
:func:`frozendict` constructor. A frozendict is :term:`hashable` if all of
545+
its keys and values are hashable, in which case it can be used as an element
546+
of a set, or as a key in another mapping. :class:`!frozendict` is not a
547+
subclass of :class:`dict`; it inherits directly from :class:`object`.
548+
549+
.. versionadded:: 3.15
550+
551+
538552
Callable types
539553
--------------
540554

0 commit comments

Comments
 (0)