simplistix / configurator

A Python library for handling configuration files.
https://configurator.readthedocs.io
MIT License
39 stars 6 forks source link

support delattr #13

Closed wimglenn closed 1 year ago

wimglenn commented 1 year ago

When attempting to replace the global configuration container in a big and old project (which was using an optparse.Values-like thing), we got bitten by this:

>>> cfg = Config(data={"foo": 1, "bar": 2})
>>> hasattr(cfg, "foo")
True
>>> delattr(cfg, "foo")
AttributeError: 'Config' object has no attribute 'foo'

This PR adds support for deletion.