GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-146440: Add an example for the json array_hook decoder parameter by fedonman · Pull Request #154522 · python/cpython

Conversation

@fedonman

@fedonman fedonman commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The array_hook parameter added to the JSON decoders in gh-146440 has version notes but no example, while the "Customizing JSON object decoding" section only shows object_hook and parse_float.

This adds two short examples there: one turning every JSON array into a tuple, and one pairing array_hook with object_pairs_hook to get a deeply immutable result, which is the use case the JSONDecoder docstring already describes. Both are marked # doctest: +SKIP, since the parameter needs Python 3.15 or later and the docs are often built with an older interpreter.

While there, it fixes a small wording slip in the array_hook parameter description ("decoded with as a Python list") and a typo ("structute") in the JSONDecoder docstring.

Documentation only, so there is no news entry.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@fedonman
pythongh-146440: Add an example for the json array_hook decoder param…
3b3efc6
…eter
@bedevere-app bedevere-app Bot mentioned this pull request Jul 23, 2026
Add "array_hook" parameter to JSON decoder #146440
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Jul 23, 2026
@read-the-docs-community

read-the-docs-community Bot commented Jul 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33765008 | 📁 Comparing 4f627df against main (206788a)

  🔍 Preview build  

11 files changed · ± 11 modified

± Modified

  • license.html
  • library/asyncio-eventloop.html
  • library/ctypes.html
  • library/difflib.html
  • library/exceptions.html
  • library/json.html
  • library/logging.handlers.html
  • library/msvcrt.html
  • library/stdtypes.html
  • whatsnew/3.16.html
  • and 1 more...
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fedonman
Merge branch 'main' into docs-json-array-hook-example
4f627df
@ambv ambv added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes skip news labels Oct 23, 2026
@ambv
ambv merged commit 6d6b1ab into python:main Oct 23, 2026
59 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Oct 23, 2026

Copy link
Copy Markdown

Thanks @fedonman for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting review label Oct 23, 2026
@miss-islington-app

miss-islington-app Bot commented Oct 23, 2026

Copy link
Copy Markdown

Sorry, @fedonman and @ambv, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 6d6b1ab4c8a8f3d1c94b3fa94e691cf9a81d2589 3.14
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned ambv Oct 23, 2026
@bedevere-app

bedevere-app Bot commented Oct 23, 2026

Copy link
Copy Markdown

GH-160465 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 23, 2026
ambv pushed a commit that referenced this pull request Oct 23, 2026
@miss-islington @fedonman
[3.15] gh-146440: Add an example for the json array_hook decoder para…
0db98cc
…meter (GH-154522) (GH-160465)

(cherry picked from commit 6d6b1ab)

Co-authored-by: Vyron Vasileiadis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@ambv ambv

Labels

needs backport to 3.14 bugs and security fixes skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@fedonman @ambv
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.