Adding a method to an instance

Kirby Urner urner at
Sat Mar 3 07:24:35 CET 2001

Kirby Urner <urner at> wrote:

>In saying f.__class__, you point back to the superclass foo.
>If you want to poke newMethod into object f alone, then you 
>should just go:
>f = newMethod


f.newMethod = newMethod

-- you need to have a method name on the receiving end, lest
you rebind f entirely, my mistake.

The ensuing example was more correct.


More information about the Python-list mailing list