Possible to fake object type?

Chris Liechti cliechti at gmx.net
Sat Mar 2 15:14:43 EST 2002


Michael 'Mickey' Lauer <mickey at tm.informatik.uni-frankfurt.de> wrote 
in news:3c812217 at nntp.server.uni-frankfurt.de:
>> def __getattr__(self, name): try:
>>                return self.__dict__[name]
>>        except NameError: return getattr(gtk.HandleBox, name)
> 
> This is basically the same as I have now. But the thing is:
> __getattr__ only gets called when the attribute _doesn't_ exist,

you're right - i thought this has changed in py 2.2 but i never used 
it that way.

maybe you could replace your classes __dict__ with an empty one so 
that __getattr__ get called?

-- 
Chris <cliechti at gmx.net>




More information about the Python-list mailing list