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
YAML lists should be formatted compactly as [1, 2, 3, 4] rather than
[1, 2, 3, 4]
- 1 - 2 - 3 - 4
The text was updated successfully, but these errors were encountered:
I think this issue can be managed by the default_flow_style kwarg. Should I change the default kwarg to be "default_flow_style=True"? @zhijian-liu
Sorry, something went wrong.
Thanks! I actually tried to tweak this before; however, it does not work as expected.
Here is a sample testing code:
import yaml import tempfile configs = { 'a': 1, 'b': [1, 2, 3, 4], 'c': { 'd': 1 } } for default_flow_style in [True, False, None]: print(yaml.dump(configs, default_flow_style=default_flow_style))
The output of default_flow_style=True is
default_flow_style=True
{a: 1, b: [1, 2, 3, 4], c: {d: 1}}
The output of default_flow_style=False is
default_flow_style=False
a: 1 b: - 1 - 2 - 3 - 4 c: d: 1
The output of default_flow_style=None is
default_flow_style=None
a: 1 b: [1, 2, 3, 4] c: {d: 1}
I somehow expect a mixture of the last two:
a: 1 b: [1, 2, 3, 4] c: d: 1
Would love to know what you think. Thanks!
raunakdoesdev
No branches or pull requests
YAML lists should be formatted compactly as
[1, 2, 3, 4]
rather thanThe text was updated successfully, but these errors were encountered: