replacing instance __setattr__

Robin Becker robin at jessikat.fsnet.co.uk
Thu Jul 4 05:24:52 EDT 2002


In article <yAZtHKAwg0I9EwKP at jessikat.demon.co.uk>, Robin Becker
<robin at jessikat.fsnet.co.uk> writes
>Is there something intrinsically hard about overriding an instance's special 
>methods? I'm using
>python 2.2 and expected that it would be easy to wrap an existing __setattr__, 
>but
>it seems the class is searched first not the instance. Must I clone the class 
>and
>set the method on that?
>
....
well it seems Python not as dynamic as I believed. The object is
searched last which seems completely counter-intuitive to me, but there
you go.
-- 
Robin Becker



More information about the Python-list mailing list