[Python-ideas] PEP 426, YAML in the stdlib and implementation discovery
Stefan Drees
stefan at drees.name
Wed Jun 5 09:31:35 CEST 2013
On 04.06.13 21:57, Vinay Sajip wrote:
> Philipp A. <flying-sheep at ...> writes:
>
>> PyYAML might not implement YAML 1.2 fully on paper, but the most useful
>> part of 1.2 (parsing arbitrary JSON) works flawlessly.
>
> Does it? What about this issue?
>
> https://bitbucket.org/xi/pyyaml/issue/11/valid-json-not-being-loaded ...
while some text of my previous reply to this mail (which is already in
the archives, but has not yet reached my mailbox again) may be
interesting read and the YAML spec might really profit from some
rewriting to clarify the JSON-YAML relation, I overlooked "production
53" in [1] and the notion of what YAML uses a superset of C escape
sequences realy means =(
Too make it short, I hereby state:
Oops, the YAML spec claims a superset of C escape-sequences, and in
production 53 (c.f. [1]) explicitly adds "/" to the grammar as
"""Escaped ASCII slash (#x2F), for JSON compatibility. """
So automatic hand-over of a double-quoted JSON as YAML string to a C
compiler goes not conform with the spec.
References:
[1]: http://www.yaml.org/spec/1.2/spec.html#id2776785
All the best and sorry for any confusion I may have introduced that was
not educational nor entertaining,
Stefan.
More information about the Python-ideas
mailing list