dictionary and __getattr__
Peter Hansen
peter at engcorp.com
Thu Sep 6 15:19:20 EDT 2001
Skip Montanaro wrote:
>
> > Hey, won't the new 2.2 support for extending built-in classes such as
> > dictionaries make this both easy and complete?
>
> Yup:
> ...
>
> Peter> Great, so now instead of KeyError you can get either KeyError
> Peter> _or_ AttributeError for what is effectively the same problem?
>
> All I was doing was responding that, "yes, you can do this by subclassing
> dictionary in 2.2. I was making no judgement about the wisdom of doing
> that.
Sorry.. I wasn't attacking _you_. I was attempting to sound
sarcastic about the original concept, given that the
inevitable result of such a concept would be the situation
I described. Your post just happened to be the one I
responded to. My mistake. :)
--
----------------------
Peter Hansen, P.Eng.
peter at engcorp.com
More information about the Python-list
mailing list