Thanks for your responses. im_func is all I need. I considered
subclassing, wchih is more easy to extend, but I needed some quick way
to add a method to another class.
Regards,
Marek
--
http://mail.python.org/mailman/listinfo/python-list
marekw2143 wrote:
Hi,
I have one class (A) that has defined method createVars. I would like
to add that method to class B
The code looks like this:
class A(object):
def createVars(self):
self.v1 = 1
self.v2 = 3
pass
class B(object):
pass
I don't want to use inheritan
marekw2143 wrote:
> Hi,
>
> I have one class (A) that has defined method createVars. I would like
> to add that method to class B
> The code looks like this:
>
>
> class A(object):
>def createVars(self):
> self.v1 = 1
> self.v2 = 3
> pass
>
> class B(object):
>pass
>
Hi,
I have one class (A) that has defined method createVars. I would like
to add that method to class B
The code looks like this:
class A(object):
def createVars(self):
self.v1 = 1
self.v2 = 3
pass
class B(object):
pass
I don't want to use inheritance (because class A