Revision 4 as of 2004-11-12 18:42:45

Clear message

There has been some confusion between "In memory storage of configuration data" and "Simple persistent storage of configuration data". Part of the problem is that almost every configuration storage system (including ConfigParser, optparse, and getopt) comes with its own in-memory API. In memory needs a good programmer API. Persistent needs a good user API, and may not need to reflect the full power of the in-memory. How should we separate these?

ConfigParser NG Goals: Competing Concepts

Keep It Simple And Useful

In this target, the existing ConfigParser interface is cleaned up and modernised. Features such as string interpolation should be separated out from the base ConfigParser class, in order to lower the entry level for usage and the overall simplicity of the base class.

Attribute and mapping-like access should not be included, as it teaches the Python beginner a bad habit early on in their programming life. Both are essentially syntactic hacks, attribute access also places unnecessary restrictions on the key item - it must be matched by [a-zA-Z_][a-zA-Z0-9_]+ (ie. Python identifer).

Comments

There is no single standard library module that I swear at more often than ConfigParser. It is beyond disgusting, yet it's core functionality is infinitely useful in nearly every small application I write. In none of these applications would a more complex configuration system be used, so adding a "ConfigParser2" in the style of urllib2 (needless complexity) would not benefit me at all. I suspect this is the case for most current users of the ConfigParser module. -- DavidWilson.

Pros

Cons

Implementations

Please add your simple ConfigParser-NG implementation hyperlinks here.

Rich, Complex Data Storage

Many programs are built these days by assembling components together, and Python programs are no exception. In general, the designer may choose to expose multiple configuration points, and will benefit if there is one standard way of doing so. From the perspective which views programs as hierarchical constructions of configurable components, it would seem to follow logically that configuration of the components should also be hierarchical in nature. The two-level (section, key) model as exemplified by the present ConfigParser does not offer sufficient power. If it did, why does Windows need a registry? ;-)

I've posted a more detailed proposal on the HierConfig page.

Pros

Cons

Unable to edit the page? See the FrontPage for instructions.