Skip to content

Commit eeb1cd7

Browse files
committed
gh-152636: Add a note that frozendict is preferable than MappingProxytype
1 parent edcc07d commit eeb1cd7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Doc/library/types.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,13 @@ Standard names are defined for the following types:
390390
signifying (respectively) the types of the underlying mapping's keys and
391391
values.
392392

393+
.. warning::
394+
395+
``MappingProxyType`` can expose its internal mapping
396+
in some rare cases on some versions of Python.
397+
Starting from Python 3.15 it is recommeneded
398+
to use truly immutable :class:`frozendict` instead.
399+
393400
.. versionadded:: 3.3
394401

395402
.. versionchanged:: 3.9

0 commit comments

Comments
 (0)