Skip to content

Support Immutable config object #39

@akalex

Description

@akalex

It would be nice if I could have the possibility to set that the config object is immutable once I loaded all needed configuration files. In that case, I can be sure that my configuration won't be changed during runtime.
Just an example of it could be used

from pymlconf import Root, freeze

config = Root()
for yml_file in CONFIG_PATHS:
    if yml_file.exists():
        config.loadfile(str(yml_file))
freeze(config)

config.foo = "bar"

TypeError is raised

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions