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

Support Immutable config object #39

Open
akalex opened this issue May 21, 2020 · 0 comments
Open

Support Immutable config object #39

akalex opened this issue May 21, 2020 · 0 comments

Comments

@akalex
Copy link

akalex commented May 21, 2020

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant