Olemis Lang <olemis <at> gmail.com> writes: > This kind of problems is similar to the one mentioned in another > thread about modifying config options after executing commands. In > that case I mentioned that the same dict-like interface also holds for > WinReg and so on ... > > So thinking big (yes ! I have a big head ! ) I think that the best > approach in this case is to build an adaptation (simple) layer on top > of ConfigParser, JSON, WinReg, PyCode, YAML, ... and build specific > extensions for these formats . Perhaps the proper interfaces are > already there (e.g. `dict`, `shelve` ) and I'm just blind and looking > somewhere else ;o)
Sorry, you've lost me :-) > > import copy > > self.config = copy.deepcopy(config) > > Why ? So I'm free to mutate self.config as I see fit. > extension is cool ... what's the point about adding the new method > instead of using `DictConfigurator` directly ? When you say "the new method", if you mean "configure" - the pattern is so that a subclass can override __init__ and do additional setup before configure() is called. Regards, Vinay Sajip _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com