Skip to content

Commit 010620b

Browse files
gh-71549: Fix object.__json__ cross-references in the nit-picky docs build
Reset the module context around the object.__json__() and object.__raw_json__() directives so that they are registered outside the json namespace, like the dunders in reference/datamodel.rst, and :meth:`~object.__json__` references from other documents resolve. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent a955cf2 commit 010620b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Doc/library/json.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,6 +649,8 @@ the global :data:`copyreg.json_dispatch_table`.
649649
The *default* function is called last,
650650
only for objects that none of the above handled.
651651

652+
.. currentmodule:: None
653+
652654
.. method:: object.__json__()
653655

654656
Return a substitute object to be serialized instead of *self*.
@@ -683,6 +685,8 @@ only for objects that none of the above handled.
683685

684686
.. versionadded:: next
685687

688+
.. currentmodule:: json
689+
686690
For example, a class can serialize itself as a JSON object::
687691

688692
class Point:

0 commit comments

Comments
 (0)