[Python-Dev] ConfigParser patches

Just van Rossum just at letterror.com
Sat Oct 2 11:16:29 CEST 2004


Guido van Rossum wrote:

> > > Well, for me personally, .ini style config files still win over
> > > XML every day. And I now have significant experience with both
> > > here at ESI.
> > 
> > OK.  Do realize that plists are basically .ini style just expressed
> > in XML::
> > 
> > <?xml version="1.0" encoding="UTF-8"?>
> > <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
> > "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
> > <plist version="1.0">
> > <dict>
> >         <key>Section</key>
> >         <dict>
> >                 <key>key</key>
> >                 <string>value</string>
> >                 <key>key2</key>
> >                 <string>value2</string>
> >         </dict>
> > </dict>
> > </plist>
> > 
> > I am not thinking of anything fancy or beyond something like this;
> > .ini files expressed in XML.  Just thinking that XML might be nice
> > since all of those poor souls who don't use Python have easy access
> > to an XML parser but not necessarily a .ini file parser.
> 
> This reveals IMO a big mistake in thinking about configuration files.
> The most important user of a config file is not the programmer who has
> to get data out of it; the most important user is the user who has to
> edit the config file. The outrageous verbosity of XML makes the above
> example a complete usability liability.

Plist is handy when:
- you need a simple storage format for simple data structures
- you want to be able to edit a file manually in exceptional situations

If you need to *routinely* edit these files by hand than plist is indeed
not the right choice. It's not a pretty format, but it's well defined.

I find it extremely handy and use it all over the place. I'd be happy to
contribute plistlib.py to the std library (ie. move it one level up from
Lib/plat-mac/ ;-), but I doubt there's enough interest.

Just


More information about the Python-Dev mailing list