This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Note in 18.2. json — JSON encoder and decoder is incorrect
Type: behavior Stage: resolved
Components: Documentation Versions: Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: Markus Järvisalo, docs@python, methane
Priority: normal Keywords:

Created on 2018-04-09 07:14 by Markus Järvisalo, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg315111 - (view) Author: Markus Järvisalo (Markus Järvisalo) Date: 2018-04-09 07:14
The note in https://docs.python.org/2/library/json.html section "18.2. json — JSON encoder and decoder".

The note says incorrectly that JSON is a subset of YAML 1.2 but if you follow the text written in YAML 1.2 specification it states that:

"The primary objective of this revision is to bring YAML into compliance with JSON as an official subset."

So it should be that YAML is a subset of JSON and not the other way around.
msg315112 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2018-04-09 07:48
> "The primary objective of this revision is to bring YAML into compliance with JSON as an official subset."
>
> So it should be that YAML is a subset of JSON and not the other way around.

This sentence can be read as "JSON is subset of YAML" and "YAML is subset of JSON".
As reading the spec, it means former.

For example, http://yaml.org/spec/1.2/spec.html#id2759572 says:

> YAML can therefore be viewed as a natural superset of JSON, offering improved human readability and a more complete information model. This is also the case in practice; every JSON file is also a valid YAML file. This makes it easy to migrate from JSON to YAML if/when the additional features are required.
History
Date User Action Args
2022-04-11 14:58:59adminsetgithub: 77427
2018-04-09 07:48:23methanesetstatus: open -> closed

nosy: + methane
messages: + msg315112

resolution: not a bug
stage: resolved
2018-04-09 07:14:29Markus Järvisalocreate