]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-141510: Document isinstance change for frozendict in What's New (#146107)
authorVictor Stinner <vstinner@python.org>
Wed, 18 Mar 2026 22:09:18 +0000 (23:09 +0100)
committerGitHub <noreply@github.com>
Wed, 18 Mar 2026 22:09:18 +0000 (23:09 +0100)
Doc/whatsnew/3.15.rst

index 7d5c6e224789bee2f65f7a2ec549a45c7501a9a3..5689ecbffc4b3045def95bcd232a40dc293bc7d4 100644 (file)
@@ -221,6 +221,11 @@ The following standard library modules have been updated to accept
 :func:`eval` and :func:`exec` accept :class:`!frozendict` for *globals*, and
 :func:`type` and :meth:`str.maketrans` accept :class:`!frozendict` for *dict*.
 
+Code checking for :class:`dict` type using ``isinstance(arg, dict)`` can be
+updated to ``isinstance(arg, (dict, frozendict))`` to accept also the
+:class:`!frozendict` type, or to ``isinstance(arg, collections.abc.Mapping)``
+to accept also other mapping types such as :class:`~types.MappingProxyType`.
+
 .. seealso:: :pep:`814` for the full specification and rationale.
 
 (Contributed by Victor Stinner and Donghee Na in :gh:`141510`.)