Closed GoogleCodeExporter closed 9 years ago
Indeed, it looks like a bug in the YAML 1.1 specification. Jesse Beder gave a
very helpful answer. It is really useful.
I see now problem areas in the YAML 1.2 specification. For instance if a value
starts with '+' then a JSON parser will create a string while the YAML 1.2
parser should create a float. Since YAML 1.2 is a superset of JSON it does not
lead to inconsistency but it will cause some misunderstanding.
I do not see a problem to fix this in the coming 1.9 release.
Original comment by py4fun@gmail.com
on 25 Jul 2011 at 9:00
a few questions on the way to implement the fix:
1) what should be the class of the result '8e+08' ? Double ? Integer (or
BigInteger if Integer or Long do not fit). I think 'e' must always require a
Double.
2) normal integers match the regular expression for floats in the YAML 1.2
specification. It means that integers must be matched always first. I think
they shall fix the regular expression for floats in YAML 1.2
Original comment by py4fun@gmail.com
on 25 Jul 2011 at 9:28
Fixed. The fix will be delivered in version 1.9
Wiki updated:
http://code.google.com/p/snakeyaml/wiki/Documentation#Deviation_from_PyYAML
Original comment by py4fun@gmail.com
on 26 Jul 2011 at 2:00
Original issue reported on code.google.com by
xan...@gmail.com
on 23 Jul 2011 at 5:44