Skip to content

Commit c4bd2e0

Browse files
committed
Basic documentation
1 parent 4cd3b4b commit c4bd2e0

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

Doc/library/stdtypes.rst

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4914,8 +4914,8 @@ The constructors for both classes work the same:
49144914

49154915
.. _typesmapping:
49164916

4917-
Mapping Types --- :class:`dict`
4918-
===============================
4917+
Mapping Types --- :class:`dict`, :class:`frozendict`
4918+
====================================================
49194919

49204920
.. index::
49214921
pair: object; mapping
@@ -4926,8 +4926,9 @@ Mapping Types --- :class:`dict`
49264926
pair: built-in function; len
49274927

49284928
A :term:`mapping` object maps :term:`hashable` values to arbitrary objects.
4929-
Mappings are mutable objects. There is currently only one standard mapping
4930-
type, the :dfn:`dictionary`. (For other containers see the built-in
4929+
Mappings are mutable objects. There is currently two standard mapping
4930+
types, the :dfn:`dictionary` and :class:`frozendict`.
4931+
(For other containers see the built-in
49314932
:class:`list`, :class:`set`, and :class:`tuple` classes, and the
49324933
:mod:`collections` module.)
49334934

@@ -5199,6 +5200,15 @@ can be used interchangeably to index the same dictionary entry.
51995200
.. versionchanged:: 3.8
52005201
Dictionaries are now reversible.
52015202

5203+
.. class:: frozendict(**kwargs)
5204+
frozendict(mapping, /, **kwargs)
5205+
frozendict(iterable, /, **kwargs)
5206+
5207+
Return a new frozen dictionary initialized from an optional positional
5208+
argument and a possibly empty set of keyword arguments.
5209+
5210+
.. versionadded:: next
5211+
52025212

52035213
.. seealso::
52045214
:class:`types.MappingProxyType` can be used to create a read-only view
@@ -5532,6 +5542,7 @@ list is non-exhaustive.
55325542
* :class:`list`
55335543
* :class:`dict`
55345544
* :class:`set`
5545+
* :class:`frozendict`
55355546
* :class:`frozenset`
55365547
* :class:`type`
55375548
* :class:`asyncio.Future`

0 commit comments

Comments
 (0)