ConfigParser shootout, preliminary entry

David Wilson dw at botanicus.net
Thu Oct 21 17:53:10 EDT 2004


On Sun, Oct 17, 2004 at 03:13:01PM -0700, Michael Chermside wrote:

> Thanks in advance for reviewing this.

Hi Michael!

I'm sorry, I did not take the time to give you my thoughts on your
approach. I will now do so. :)

My principle worry is that the use of attributes is both magical for
beginners and limiting for international users. Consider the case of an
Asian user who wishes to use names of his family members as keys, then
consider the case of a beginner who thinks attribute access is the
natural style of data access in Python, only to find later there is also
__getitem__ and method calls.

Second of all, I believe that the exceptions used are too verbose, and
not usefully so. Two or three of your exceptions are dedicated to type
conversion, something that Python can handle wonderfully on it's own.

What can you really do when your application detects a
"BitFlippedInLowerHalfOfFile" error? In most cases all it will do is
alert the user, so why bother? I'd like to see some use cases for your
exceptions, other than their user-oriented error strings.

Another place where my opinion differs is in your extensive use of
custom types - are they really all needed to achieve your goal? And if
so, don't you think they are a little complex?


Tangent

I originally embarked on the path to 'enPythonment' when I wandered
across the standard library directory by accident one day. The strange,
yet clearly structured syntax got me on to the next stage of reading the
tutorial.

Throughout the tutorial (and in later Python life) I referred to the
standard library to try to learn techniques and to understand various
functions of Python.

One thing I remember from those days was that the standard library
taught me a few bad habits, and also my surprise when I found much
cleaner Python code outside the standard library than I did inside.

My secondary goal for this module is to be as clear, concise, and
correct as I can be. Should someone stumble upon this module during
their learning experience, hopefully they will learn some of the core
Python idealogies rather than the more recent trends toward syntactical
hacks and meta-object-wibble-widget madness (my apologies if that last
bit didn't make sense :).

The module, as it stands, is a very simple OO method for reading
INI-like files. That is what it is designed to be, and that is what I
want any reader of the code to see.

Thanks,


David.

-- 
Gentoo, for when 13 hours of your time is worth more than the 0.1
nanoseconds your CPU saves during use.



More information about the Python-list mailing list