Post by Chris RebertPost by Brendan MillerI'm just curious whether PyYaml is likely to end up in the standard
library at some point?
I don't personally have a direct answer to your question, but I can
point out that JSON and YAML are mostly compatible (JSON is almost a
perfect YAML subset) and the `json` module is already in the Python
std lib.
Cheers,
Chris
Yes, JSON is an (I think unintentional) subset of YAML... but a fairly
small subset.
A list in YAML looks like
--- # my list
- Elem 1
- Elem 2
Whereas in JSON you have ["Elem 1", "Elem 2"]. People say JSON is a
subset because YAML will also accept the JSON style syntax if you want
to do something inline for convenience:
--- # my list containing a sublist in the second element.
- Elem 1
- ["Sub elem 1", "Sub elem 2"]
But this is really a special purpose syntax in the context of YAML.
I think the json module sticks everything on the same line, which
isn't readable for large data structures. My impression is YAML is
that is is more readable than JSON, whereas JSON is mostly for browser
interop.