-
-
Notifications
You must be signed in to change notification settings - Fork 34.3k
gh-146440: Add "array_hook" parameter to JSON decoders #146441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+114
−11
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
ced66ad
array_hook for JSON decoder
jsbueno cdb6dcf
Update documentation for array_hook parameter
jsbueno c7b77ee
📜🤖 Added by blurb_it.
blurb-it[bot] be6cb37
Fix typo in news blurb
jsbueno 2820503
Fix doc formatting
jsbueno b079384
Doc typo
jsbueno 7ff9a73
'What's New' entry
jsbueno 47072c3
Remove redundant default parameters
jsbueno 9cd60a5
Fix blurb content + formatting
jsbueno 6e48297
Formatting and missing parameter to JSONDecoder
jsbueno 0eed2fb
Reformat blurb
jsbueno ee285ae
Merge branch 'main' into feature-json-array-hook
jsbueno 2942826
Update Doc/whatsnew/3.15.rst
jsbueno 227b52d
Linting fixes
jsbueno 58d8897
Capitalization typo
jsbueno 2a9cdd5
PEP 7 + Py_IsNone macro in functions touched
jsbueno 9dc1258
Revert "PEP 7 + Py_IsNone macro in functions touched"
jsbueno fc82117
Change version to 'next'
jsbueno c4d6b37
Nested list + frozendict testcase
jsbueno 8ea13ff
Apply suggestions from code review
vstinner d1e2077
Apply suggestions from code review
vstinner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
6 changes: 6 additions & 0 deletions
6
Misc/NEWS.d/next/Library/2026-03-26-02-06-52.gh-issue-146440.HXjhQO.rst
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| :mod:`json`: Add the *array_hook* parameter to :func:`~json.load` and | ||
| :func:`~json.loads` functions: | ||
| allow a callback for JSON literal array types to customize Python lists in the | ||
| resulting decoded object. Passing combined :class:`frozendict` to | ||
| *object_pairs_hook* param and :class:`tuple` to ``array_hook`` will yield a | ||
| deeply nested immutable Python structure representing the JSON data. |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.