I just ran into a potential issue with integer parsing, when combing reading and writing of the yaml R package with other packages/languages.
According to the yaml integer specification:
Any “_” characters in the number are ignored, allowing a readable representation of large values
However, if I yaml::write_yaml(list("1_2_3"=4), file="test.yaml") this gives me the following resulting file:
If I read this with with another parser (e.g., in Python) I will get a {123: 4}, where the 123 key is an integer.
To be safe, should the package maybe quote all "integer and underscores" keys/values?
I just ran into a potential issue with integer parsing, when combing reading and writing of the
yamlR package with other packages/languages.According to the yaml integer specification:
However, if I
yaml::write_yaml(list("1_2_3"=4), file="test.yaml")this gives me the following resulting file:If I read this with with another parser (e.g., in Python) I will get a
{123: 4}, where the123key is an integer.To be safe, should the package maybe quote all "integer and underscores" keys/values?