[Python-Dev] ConfigParser shootout, preliminary entry

Guido van Rossum gvanrossum at gmail.com
Wed Oct 20 17:25:34 CEST 2004


> The opt* property builders could be substituted by a single opt which
> took the default value as an argument:
> 
> opt(section_name, key_name, default_value)

What if I want the default to be None?  Sometimes absence of a value
is useful info. If you want a single factory function (not sure why)
then maybe the type should be passed in (perhaps optional, only if no
default is given).

> It works well as far as the option names are unique. In some cases,
> there are sections with a similar internal structure, and in this case
> the use of nested structures to represent sections is better.

"Better" is subjective. With my approach, you can give them different
prefixes in the Python API independent from their names as seen by the
user, and you only have to do this when there are actual conflicts
(which are rare except when certain styles are used).

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-Dev mailing list