Skip to content
Prev Previous commit
Update docs.
  • Loading branch information
serhiy-storchaka committed Dec 24, 2023
commit 4366dd62609ac0a4b0cb3f8ea121fedc45d6ee8d
4 changes: 4 additions & 0 deletions Doc/library/json.rst
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ Encoders and Decoders
.. versionchanged:: 3.6
All parameters are now :ref:`keyword-only <keyword-only_parameter>`.

.. versionchanged:: 3.13
:exc:`TypeError` is raised if the default serialization function
returns a result of the same type as the input.


.. method:: default(o)

Expand Down
4 changes: 4 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1163,6 +1163,10 @@ Changes in the Python API
other "private" attributes.
(See :gh:`112826`.)

* :exc:`TypeError` is now raised in the :mod:`json` encoder if the default
serialization function returns a result of the same type as the input.
(Contributed by Siddharth Velankar and Serhiy Storchaka in :gh:`74917`.)


Build Changes
=============
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
:exc:`TypeError` is now raised in the :mod:`json` encoder if the default
serialization function returns a result of the same type as the input.