Efficient configuration storage
ialbert at mailblocks.com
Wed Sep 22 18:46:03 CEST 2004
> Would I have to store everything as text and cast it everywhere
> it's used (and try/except each cast of course) ?
> 'Looks ugly and inefficient to me.
Are you sure that casting types onto configuration parameters
will make webgobbler inefficient?
And you don't have to catch the exceptions all the time,
just once overall. Usually configuration files don't change that
often and .ini file are very simple so it is easy to spot
the cause of error. So it is not even ugly anymore.
IMHO enforcing these types at load time is a good idea.
Having to track down an error caused inside the program by
a wrong type listed in a configuration file is not fun.
More information about the Python-list