Assignment not the same as defining?

Emile van Sebille emile at fenx.com
Wed Oct 3 09:47:05 EDT 2001


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

HTH,

--

Emile van Sebille
emile at fenx.com

---------
"Dale Strickland-Clark" <dale at riverhall.NOSPAMco.uk> wrote in message
news:3itlrt0hds3sjjjt5apj53oo9840sopomp at 4ax.com...
> 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