beetbox / confuse

painless YAML config files for Python
https://pypi.org/project/confuse/
MIT License
415 stars 51 forks source link

allow removing items or sources from config #132

Open cloud-rocket opened 3 years ago

cloud-rocket commented 3 years ago

@sampsyo - are you open to merge something like this to allow removing sources and deleting config items.

(This branch is for a review and not for merging now as it does not contain enough testing).

Thanks

cloud-rocket commented 2 years ago

@sampsyo - do you think you can merge it?

Thank you!

sampsyo commented 2 years ago

Hi! Seems generally useful, but perhaps somewhat tricky to explain exactly what's going on. Removing entire sources seems like it could have somewhat unpredictable effects on the data model. Removing individual keys (i.e., the opposite of add) seems perhaps more intuitive, but it also seems like it might be sort of difficult to guarantee that add and remove are actually opposites—that is, that removing something that was previously added at a given point in the configuration tree leaves us back in the original place. Does that make any sense?

It might be useful to have a somewhat broader conversation about the use case you're running into here so we can refine the proposal a bit. Is there a specific case where this came up?