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

A more flexible fix for custom tag constructors #279

Merged
merged 1 commit into from Mar 31, 2019

Commits on Mar 19, 2019

  1. Add custom constructors to multiple loaders

    When someone writes a subclass of the YAMLObject class, the constructors
    will now be added to all 3 (non-safe) loaders.
    
    Furthermore, we support the class variable `yaml_loader` being a list,
    offering more control of which loaders are affected.
    
    To support safe_load in your custom class you could add this:
    
        yaml_loader = yaml.SafeLoader
    
        yaml_loader = yaml.YAMLObject.yaml_loader
        yaml_loader.append(yaml.SafeLoader)
    ingydotnet committed Mar 19, 2019
    Copy the full SHA
    00e9935 View commit details
    Browse the repository at this point in the history