PEP 837: Extensible JSON serialization#5031
Open
serhiy-storchaka wants to merge 5 commits into
Open
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Documentation build overview
|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
Discussion thread: https://discuss.python.org/t/pep-837-extensible-json-serialization/108124 (Discussions-To and Post-History headers added). |
hugovk
reviewed
Jul 12, 2026
hugovk
left a comment
Member
There was a problem hiding this comment.
I probably won't have time for a full review due to EuroPython, here's a couple of suggestions.
| Discussions-To: https://discuss.python.org/t/pep-837-extensible-json-serialization/108124 | ||
| Status: Draft | ||
| Type: Standards Track | ||
| Created: 11-Jul-2026 |
Member
There was a problem hiding this comment.
Suggested change
| Created: 11-Jul-2026 | |
| Created: 12-Jul-2026 |
Member
Author
There was a problem hiding this comment.
I wrote it 11-Jul-2026, but submitted next morning 12-Jul-2026. What counts?
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Also fix the markup of the '__raw_json__ as a pure marker' bullet (inline markup cannot be nested) and escape numpy.bool_ in the appendix. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
Thank you. Fixed rendering and modernized cpython-issue references. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New PEP proposing an extension mechanism for the
jsonencoder atthree levels: the
__json__()/__raw_json__()protocol (librarylevel), a
copyreg.json()registry following thecopyreg.pickle()precedent (application level), and a per-encoder
dispatch_tableattribute mirroring
pickle.Pickler(call level).Reference implementation: python/cpython branch
json-customize4(link: https://github.com/serhiy-storchaka/cpython/tree/json-customize4).
The idea has been discussed repeatedly since 2010; see the PEP's
Motivation for the tracker issues and the python-ideas /
discuss.python.org threads:
2010,
2019,
2020,
2022 (registry),
2022–2024 (
__json__).Basic requirements (all PEP Types)
pep-NNNN.rst), PR title (PEP 123: <Title of PEP>) andPEPheaderAuthororSponsor, and formally confirmed their approvalAuthor,Status(Draft),TypeandCreatedheaders filled out correctlyPEP-Delegate,Topic,RequiresandReplacesheaders completed if appropriate (none applicable).github/CODEOWNERSfor the PEPStandards Track requirements
🤖 Generated with Claude Code