Skip to content

gh-146440: Add "array_hook" parameter to JSON decoders#146441

Open
jsbueno wants to merge 4 commits intopython:mainfrom
jsbueno:feature-json-array-hook
Open

gh-146440: Add "array_hook" parameter to JSON decoders#146441
jsbueno wants to merge 4 commits intopython:mainfrom
jsbueno:feature-json-array-hook

Conversation

@jsbueno
Copy link

@jsbueno jsbueno commented Mar 26, 2026

Add array_hook parameter to json.load and json.loads

gh-146440: Add "array_hook" parameter to JSON decoder 

📚 Documentation preview 📚: https://cpython-previews--146441.org.readthedocs.build/

jsbueno added 2 commits March 25, 2026 22:55
     Add array_hook parameter, to both
     Python and C implementations
@bedevere-app
Copy link

bedevere-app bot commented Mar 26, 2026

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@jsbueno jsbueno changed the title Add json_array parameter to json.load and json.loads gh-146440: Add "array_hook" parameter to JSON decoders Mar 26, 2026
* Add the *array_hook* parameter to :func:`~load` and :func:`~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 imitable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: Immutable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants