PEP 837: Extensible JSON serialization#5031
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Documentation build overview
11 files changed ·
|
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Discussion thread: https://discuss.python.org/t/pep-837-extensible-json-serialization/108124 (Discussions-To and Post-History headers added). |
hugovk
left a comment
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 |
There was a problem hiding this comment.
| Created: 11-Jul-2026 | |
| Created: 12-Jul-2026 |
There was a problem hiding this comment.
I wrote it 11-Jul-2026, but submitted next morning 12-Jul-2026. What counts?
There was a problem hiding this comment.
It's the day the PEP number is assigned.
Sometimes PEPs are written months ago and iterated upon before a PR is opened and a number assigned.
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>
|
Thank you. Fixed rendering and modernized cpython-issue references. |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
# Conflicts: # .github/CODEOWNERS
PEP 837 was freed for this PEP's earlier claim when the conflicting PEP was renumbered to 840 in python#5043. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
hugovk
left a comment
There was a problem hiding this comment.
Approved with date change, thanks! :)
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