On Thu, 10 Jan 2008 14:55:18 -0800, [EMAIL PROTECTED] wrote:
> Can I access the class attributes from a method added at runtime? (My
> experience says no.)
> I experimented with the following code:
>
> [Code snipped]
>
> So it seems to me, if you add a method to an instance, the method will
> not get "self" as parameter.
You are not adding a method but a function. Take a look at
`types.MethodType()` to create a method from a function, instance, and
class.
Ciao,
Marc 'BlackJack' Rintsch
--
http://mail.python.org/mailman/listinfo/python-list