Re: Problem with inheritance

2011-10-21 Thread Jean-Michel Pichavant
Sverre wrote: I have to classes a and b class a(object): def __init__(self,x): self.x = x self.build() def build(self): return class b(a): def __init__(self,x): a.__init__(self,x) self.y = 0 # ??? def build(self): # do somethi

Re: Problem with inheritance

2011-10-21 Thread Sverre
On Oct 21, 10:07 am, Sverre wrote: > I have to classes a  and b > > class a(object): >     def __init__(self,x): >         self.x = x >         self.build() > >     def build(self): >         return > > class b(a): >     def __init__(self,x): >         a.__init__(self,x) >         self.y = 0  # ??

Re: Problem with inheritance

2011-10-21 Thread Chris Angelico
On Fri, Oct 21, 2011 at 7:07 PM, Sverre wrote: > The line marked with "???" will no be executed and I don't know the > reason. This example is working as intended, but not not the code I'm > working on. I'm using Eclipse. I don't know how to debug this > problem. > Did you notice the error you go

Problem with inheritance

2011-10-21 Thread Sverre
I have to classes a and b class a(object): def __init__(self,x): self.x = x self.build() def build(self): return class b(a): def __init__(self,x): a.__init__(self,x) self.y = 0 # ??? def build(self): # do something self.