ConfigParser shootout, preliminary entry
Peter Hansen
peter at engcorp.com
Sat Oct 23 09:55:57 EDT 2004
David Wilson wrote:
> Skip Montanaro wrote:
>
>> * Both attribute-style and dictionary-style access supported
>
> Can someone please enlighten me as to why this is a good idea? The abuse
> of __getitem__ or __getattr__ (IMHO) should only occur inside
> transparent object proxies and suchlike -- I see no relation between
> (key, value) mapping and attributes.
Is it enough to say that it is a good idea *for some people*, and
that you don't need to be convinced that it's a good idea for you,
or in general, for that to remain a fact?
And surely you don't really mean that you don't see a relation
between (key, value) mapping and attributes. You *can't* mean
that... they are both forms of associative mapping. A key or name
maps to a value. End of story. Obvious as all get out.
Perhaps you meant you don't believe that this obvious relation
is in itself a good reason to supply both methods of access?
Or some other point?
-Peter
More information about the Python-list
mailing list