Discussion:
PyYaml in standard library?
Brendan Miller
2009-02-18 09:11:09 UTC
Permalink
I'm just curious whether PyYaml is likely to end up in the standard
library at some point?
Chris Rebert
2009-02-18 09:34:08 UTC
Permalink
Post by Brendan Miller
I'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
--
Follow the path of the Iguana...
http://rebertia.com
Brendan Miller
2009-02-18 22:31:16 UTC
Permalink
Post by Chris Rebert
Post by Brendan Miller
I'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.
unknown
2009-02-19 01:31:58 UTC
Permalink
Post by Brendan Miller
I think the json module sticks everything on the same line, which
isn't readable for large data structures.
It has a prettyprint option.
Jesse Noller
2009-02-19 02:14:06 UTC
Permalink
Post by Brendan Miller
I'm just curious whether PyYaml is likely to end up in the standard
library at some point?
--
http://mail.python.org/mailman/listinfo/python-list
Personally, loving the hell out of yaml (and pyyaml) as much as I do,
I'd love to see this; however interested people should pass the idea
to python-ideas, and write a PEP. It would need a dedicated maintainer
as well as the other things stdlib modules require.

-jesse

Loading...