pyyaml
pyyaml copied to clipboard
Disable Aliases/Anchors
Expected Behaviour
- Ability to disable generated aliases and anchors (AA) in
yaml.dump()
Use Case
- Tool for generating default
yamlconfig file for an application - Users of the generated config file should not need to know how AA work
Actual Behaviour
- No option to disable AA
Current Workaround
class NoAliasDumper(yaml.Dumper):
def ignore_aliases(self, data):
return True
yaml.dump(x, Dumper=NoAliasDumper)
Potential Solution
- Add a flag to
yaml.dump()that switches the functionality ofignore_aliases()
Update on this? Should really just be a nice clean option.
I'm still doing the (imo dirty) line: yaml.Dumper.ignore_aliases = lambda *args: True from this SO post.
bump
rebump
ba-ba-bump!