pyyaml icon indicating copy to clipboard operation
pyyaml copied to clipboard

Scientific notation is not properly quoted

Open rickardp opened this issue 6 months ago • 0 comments

>>> import yaml
>>> yaml.dump("1E6")
'1E6\n...\n'

This is assumed to be a string, but some libraries (most notably Go) interprets this as a number in scientific notation. Would it be better to quote these? I'm not sure what the spec says, but right now this is an incompatiblity (Strings are read back as numbers)

rickardp avatar Apr 29 '25 16:04 rickardp