Re: moving methods from class to instance of other class

2012-06-28 Thread Terry Reedy
On 6/28/2012 2:59 AM, lars van gemerden wrote: class A(object): def __init__(self): self.name = 'a' def do(self): print 'A.do: self.name =', self.name class B(object): def __init__(self): self.name = 'b' The question is: How do i move the 'do' method f

Re: moving methods from class to instance of other class

2012-06-28 Thread lars van gemerden
On Jun 28, 9:22 am, Benjamin Kaplan wrote: > On Wed, Jun 27, 2012 at 11:59 PM, lars van gemerden > > > > > > > > > > wrote: > > Hi all, > > > I have some trouble with the following question: Let say i have the > > following classes: > > > class A(object): > >    def __init__(self): > >        sel

Re: moving methods from class to instance of other class

2012-06-28 Thread Benjamin Kaplan
On Wed, Jun 27, 2012 at 11:59 PM, lars van gemerden wrote: > Hi all, > > I have some trouble with the following question: Let say i have the > following classes: > > class A(object): >    def __init__(self): >        self.name = 'a' >    def do(self): >        print 'A.do: self.name =', self.name

moving methods from class to instance of other class

2012-06-28 Thread lars van gemerden
Hi all, I have some trouble with the following question: Let say i have the following classes: class A(object): def __init__(self): self.name = 'a' def do(self): print 'A.do: self.name =', self.name class B(object): def __init__(self): self.name = 'b' The q