[Python-ideas] PEP 426, YAML in the stdlib and implementation discovery

Daniel Holth dholth at gmail.com
Fri May 31 22:22:21 CEST 2013


On Fri, May 31, 2013 at 3:27 PM, Philipp A. <flying-sheep at web.de> wrote:
> 2013/5/31 Guido van Rossum <guido at python.org>
>>
>> On Fri, May 31, 2013 at 11:35 AM, Brett Cannon <brett at python.org> wrote:
>> > So yaml is not going to end up in the stdlib. The format is not used
>> > widely enough to warrant being added nor have to maintain a parser for
>> > such a complicated format.
>>
>> Hm. What makes you think it's not being used widely enough? I suppose
>> JSON is more popular, but it's not like YAML is dying. AFAIK there's a
>> 3rd party yaml parser that we could incorporate with its authors'
>> permission -- this would save people from a pretty common dependency
>> (just like we did for JSON).
>
>
> i think ruby created its own reality here: yaml wasn’t popular because it
> wasn’t in the stdlib, and became popular as soon as it was. its advantages
> as arguably most human-writable serialization format helped here. at least
> that’s my interpretation.

I kindof like the idea of a stdlib YAML. IIUC the format competes with
XML and pickle in interesting ways, avoiding in-band signaling like
"keys starting with a $" or whatever that sometimes happens with JSON.

It doesn't make sense as the serialization format for packaging
metadata. *.dist-info/pymeta.json, to be parsed at install time to
resolve dependency graphs, has no human readability/writability
requirement, but must be fast, simple to implement, and available on
Python 2.6+.

At least for the 100k+ existing pypy-hosted sdists the metadata input
format is a Python program called "setup.py". YAML could be a good
alternative. Perhaps you could try doing a YAML version of Bento's
configuration language?

Right now the thinking in packaging is that there will not be *a*
standard setup.py replacement. Instead, we will define hooks so that
your build tool can generate the static metadata and build your
package, and the install tools will be able to interoperate from
there.


More information about the Python-ideas mailing list