[Tutor] Dynamically changing a class
Ricardo Aráoz
ricaraoz at gmail.com
Wed Sep 5 11:58:12 CEST 2007
Alan Gauld wrote:
> "Kent Johnson" <kent37 at tds.net> wrote
>
>>> Wanted to change the mfunc method but ONLY for an instance, not a
>>> class:
>> I believe the correct way to do this is to use the __get__() method
>> of
>> the function object to create a bound method and assign that to the
>> instance attribute:
>
> Wow! Another new trick. I've never noticed __get__ before.
That'd be two this week ;-)
> Time for some playing I think.
Yep. And once you've got it pls explain it too me, too lazy today to
pick the manual. :)
Any easier way?
>
> Thanks Kent,
>
> Alan G
>
More information about the Tutor
mailing list