Message13994
Logged In: YES
user_id=80475
I understand. Ideally, *all* methods would respond to a
single overridden method, but I think this is just a fact of
life in object oriented programming.
I can't remember where you gave an example of a
d.__getitem__() subclass override, but you were careful to
point out that other methods, like d.get() also needed to
be overridden so that the modified access applied
everywhere. Likewise, __iter__() or any other object
access method must be assumed to access the underlying
data structure directly and must be overridden. For
instance, creating a dictionary with case insensitive
lookups entails overriding __getitem__(k), get(k,default),
and pop(k) -- no one of them can be presumed to inform
the others. |
|
| Date |
User |
Action |
Args |
| 2007-08-23 14:09:57 | admin | link | issue665835 messages |
| 2007-08-23 14:09:57 | admin | create | |
|