Skip to content

Possible integer parsing issue #120

@mschubert

Description

@mschubert

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:

1_2_3: 4.0

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions