Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scientific notation is detected too loosely #668

Closed
bronger opened this issue Oct 30, 2020 · 1 comment
Closed

Scientific notation is detected too loosely #668

bronger opened this issue Oct 30, 2020 · 1 comment

Comments

@bronger
Copy link

bronger commented Oct 30, 2020

According to https://yaml.org/spec/1.2/spec.html#id2804092, 123456e1 (without quotes) is not a float but a string because there is no sign after the “e”. Also note that PyYAML yields

>>> import yaml
>>> print(yaml.dump({"a": "123456e1"}))
a: 123456e1
@bronger
Copy link
Author

bronger commented Oct 30, 2020

Sorry, I quoted the wrong part of the YAML specs, and it is a bug in PyYAML.

@bronger bronger closed this as completed Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant