问题
If I have a YAML file like
---
2.1: my product version
without any quotation marks, Ruby will treat the 2.1
as a Float (at least under Syck - I'm not sure about Psych).
Are there any risks in using a Float as a hash's key, so long as all of the other occurences of the key are either from a YAML file or literals from Ruby?
来源:https://stackoverflow.com/questions/8708113/is-it-safe-to-use-floats-in-yaml-hashes-with-ruby