Assignment not the same as defining?

Emile van Sebille emile at
Wed Oct 3 15:47:05 CEST 2001

Perhaps you could create a class setwibble(wibble):, move set into it, and
as the final step of __init__, change the class?



Emile van Sebille
emile at

"Dale Strickland-Clark" <dale at> wrote in message
news:3itlrt0hds3sjjjt5apj53oo9840sopomp at
> A solution I thought I had to using __setattr__ doesn't seem to work.
> class wibble:
> def __init__(self):
> <init code>
> self.__setattr__ = self.set
> def set(self, attr, value):
> <assignment code>
> My late bound __setattr__ is never called.
> I've clearly misunderstood something fundamental here. What am I doing
> wrong?
> Thanks
> --
> Dale Strickland-Clark
> Riverhall Systems Ltd

More information about the Python-list mailing list