Skip to content

Commit 656abe3

Browse files
authored
gh-141510: Document isinstance change for frozendict in What's New (#146107)
1 parent bcdf231 commit 656abe3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Doc/whatsnew/3.15.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ The following standard library modules have been updated to accept
221221
:func:`eval` and :func:`exec` accept :class:`!frozendict` for *globals*, and
222222
:func:`type` and :meth:`str.maketrans` accept :class:`!frozendict` for *dict*.
223223

224+
Code checking for :class:`dict` type using ``isinstance(arg, dict)`` can be
225+
updated to ``isinstance(arg, (dict, frozendict))`` to accept also the
226+
:class:`!frozendict` type, or to ``isinstance(arg, collections.abc.Mapping)``
227+
to accept also other mapping types such as :class:`~types.MappingProxyType`.
228+
224229
.. seealso:: :pep:`814` for the full specification and rationale.
225230

226231
(Contributed by Victor Stinner and Donghee Na in :gh:`141510`.)

0 commit comments

Comments
 (0)