Re: (beginners) howto ascribe _all_ fields of parent class to child class?

2007-03-14 Thread Steve Holden
dmitrey wrote: > Hi all, > I'm rewriting some code from other language to Python; can anyone > explain me which way is the simpliest: > I have > class C1(): > def __init__(self): > self.a = 5 > > class C2(C1): > def __init__(self): > self.b = 8 > > c = C2() > print c.b#

Re: (beginners) howto ascribe _all_ fields of parent class to child class?

2007-03-14 Thread Diez B. Roggisch
dmitrey schrieb: > Hi all, > I'm rewriting some code from other language to Python; can anyone > explain me which way is the simpliest: > I have > class C1(): > def __init__(self): > self.a = 5 > > class C2(C1): > def __init__(self): > self.b = 8 > > c = C2() > print c.

(beginners) howto ascribe _all_ fields of parent class to child class?

2007-03-14 Thread dmitrey
Hi all, I'm rewriting some code from other language to Python; can anyone explain me which way is the simpliest: I have class C1(): def __init__(self): self.a = 5 class C2(C1): def __init__(self): self.b = 8 c = C2() print c.b#prints 8 print c.a#prints error, because fi