Skip to content

Conversation

MichaByte
Copy link
Contributor

@MichaByte MichaByte commented May 17, 2025

This PR clears up the ambiguity between JSON objects and Python objects in the json module docs by adding a note to inform the reader of the distinction. I also changed two occurrences of the word "specializing" with the word "customizing", since the latter seems to be a better fit for describing what's happening. Let me know if I need to make any changes!

Micha


📚 Documentation preview 📚: https://cpython-previews--134154.org.readthedocs.build/en/134154/library/json.html

@python-cla-bot
Copy link

python-cla-bot bot commented May 17, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

Copy link
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

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

Please avoid changes not related to the issue, we generally try to keep pull requests focused to make them easier to review.

This does not fully resolve this issue, there are several places in the docs where it should be clarified e.g. "object" -> "JSON object"

Edit:

I apologize for my review, I was tired and very inconsiderate. Welcome to contributing to cpython, I hope this will be one of many prs:-)


.. note::
The term "object" in the context of JSON processing in Python can be
ambiguous. All values in Python are objects. In JSON, an object refers to
Copy link
Member

Choose a reason for hiding this comment

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

Glossary link to Python object?

Copy link
Member

Choose a reason for hiding this comment

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

In this case, I don't think a glossary link will help here. The reader in this case will know what a Python object is.

resources. Limiting the size of data to be parsed is recommended.

:mod:`json` exposes an API familiar to users of the standard library
This module exposes an API familiar to users of the standard library
Copy link
Member

Choose a reason for hiding this comment

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

Again unrelated, please revert and do not make a mess of this pr.

though it should be changed to

:mod:`!json`

Copy link
Member

Choose a reason for hiding this comment

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

do not make a mess of this pr.

@StanFromIreland Please be aware that this is a first-time contributor. Let's try to be more constructive by pointing to the devguide.

Copy link
Member

Choose a reason for hiding this comment

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

I think "This module" make a better sentence anyway.

}

Specializing JSON object encoding::
Customizing JSON object encoding::
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

Copy link
Member

Choose a reason for hiding this comment

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

Again, I think this is a better word, and we don't want to make a separate PR for it, it would be too much churn.

['streaming API']

Specializing JSON object decoding::
Customizing JSON object decoding::
Copy link
Member

Choose a reason for hiding this comment

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

Ditto

@ZeroIntensity ZeroIntensity added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels May 17, 2025
@MichaByte
Copy link
Contributor Author

CCing @nedbat, who helped me make these changes at PyCon

@nedbat nedbat merged commit fa4e088 into python:main May 18, 2025
28 checks passed
@miss-islington-app
Copy link

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

@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs May 18, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 18, 2025
…ythonGH-134154)

* pythongh-134150: Clarify distinction between JSON objects and Python objects in json module docs

* Revert change to JSON introduction

* Clarify occurrences of "object literal" as JSON
(cherry picked from commit fa4e088)

Co-authored-by: Micha Albert <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented May 18, 2025

GH-134166 is a backport of this pull request to the 3.14 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 18, 2025
…ythonGH-134154)

* pythongh-134150: Clarify distinction between JSON objects and Python objects in json module docs

* Revert change to JSON introduction

* Clarify occurrences of "object literal" as JSON
(cherry picked from commit fa4e088)

Co-authored-by: Micha Albert <[email protected]>
@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 18, 2025
@bedevere-app
Copy link

bedevere-app bot commented May 18, 2025

GH-134167 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 18, 2025
nedbat pushed a commit that referenced this pull request May 18, 2025
…GH-134154) (#134167)

gh-134150: Clarify distinction between JSON and Python objects (GH-134154)

* gh-134150: Clarify distinction between JSON objects and Python objects in json module docs

* Revert change to JSON introduction

* Clarify occurrences of "object literal" as JSON
(cherry picked from commit fa4e088)

Co-authored-by: Micha Albert <[email protected]>
nedbat pushed a commit that referenced this pull request May 18, 2025
…GH-134154) (#134166)

gh-134150: Clarify distinction between JSON and Python objects (GH-134154)

* gh-134150: Clarify distinction between JSON objects and Python objects in json module docs

* Revert change to JSON introduction

* Clarify occurrences of "object literal" as JSON
(cherry picked from commit fa4e088)

Co-authored-by: Micha Albert <[email protected]>
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
…ython#134154)

* pythongh-134150: Clarify distinction between JSON objects and Python objects in json module docs

* Revert change to JSON introduction

* Clarify occurrences of "object literal" as JSON
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
…ython#134154)

* pythongh-134150: Clarify distinction between JSON objects and Python objects in json module docs

* Revert change to JSON introduction

* Clarify occurrences of "object literal" as JSON
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants