dictionary and __getattr__

Skip Montanaro skip at pobox.com
Thu Sep 6 13:00:23 EDT 2001


    > 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.

-- 
Skip Montanaro (skip at pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list