We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
file content:
a: 1 b: - 10:0 - 100:0
my code
import yaml print(yaml.__version__) c = yaml.safe_load(open("./in")) print(c) c = yaml.unsafe_load(open("./in")) print(c) c = yaml.full_load(open("./in")) print(c) c = yaml.load(open("./in"), Loader=yaml.BaseLoader) print(c)
and get result:
5.3 {'a': 1, 'b': [600, 6000]} {'a': 1, 'b': [600, 6000]} {'a': 1, 'b': [600, 6000]} {'a': '1', 'b': ['10:0', '100:0']}
The text was updated successfully, but these errors were encountered:
This works as expected. The BaseLoader loads everything as a string: https://pyyaml.org/wiki/PyYAMLDocumentation The other loaders implement the YAML 1.1 types, and the integer type includes sexagesimals (numbers with base 60), which are seperated by colons: https://yaml.org/type/int.html
Sorry, something went wrong.
No branches or pull requests
file content:
my code
and get result:
The text was updated successfully, but these errors were encountered: