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

Disable Aliases/Anchors #103

Open
engnadeau opened this issue Nov 27, 2017 · 1 comment
Open

Disable Aliases/Anchors #103

engnadeau opened this issue Nov 27, 2017 · 1 comment

Comments

@engnadeau
Copy link

Expected Behaviour

  • Ability to disable generated aliases and anchors (AA) in yaml.dump()

Use Case

  • Tool for generating default yaml config 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 of ignore_aliases()
@vincerubinetti
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants