Issue 33246: Note in 18.2. json — JSON encoder and decoder is incorrect (original) (raw)
Issue33246
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) * ![]() |
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:59 | admin | set | github: 77427 |
2018-04-09 07:48:23 | methane | set | status: open -> closednosy: + methanemessages: + resolution: not a bugstage: resolved |
2018-04-09 07:14:29 | Markus Järvisalo | create |