Re: A question about inheritance

2005-05-14 Thread arserlom
Ok, thanks. I didn't know about new-style classes (I had learned python from a book prior to them). After reading about new-style classes, I find that your solution is better because, using super (in general) avoids cl2 from having to know the implementation details of cl1. This is clearly explai

Re: A question about inheritance

2005-05-08 Thread Steven Bethard
[EMAIL PROTECTED] wrote: > Hello I have a question about inheritance in Python. I'd like to do > something like this: > > class cl1: > def __init__(self): >self.a = 1 > > class cl2(cl1): > def __init__(self): >self.b = 2 > > But in such a way that cl2 instances have atributes 'b' A

Re: A question about inheritance

2005-05-08 Thread arserlom
Thanks. Jp Calderone wrote: > On 8 May 2005 12:07:58 -0700, [EMAIL PROTECTED] wrote: > >Hello I have a question about inheritance in Python. I'd like to do > >something like this: > > > > class cl1: > > def __init__(self): > > self.a = 1 > > > > class cl2(cl1): > > def __init__(self): > > se

Re: A question about inheritance

2005-05-08 Thread Jp Calderone
On 8 May 2005 12:07:58 -0700, [EMAIL PROTECTED] wrote: >Hello I have a question about inheritance in Python. I'd like to do >something like this: > > class cl1: > def __init__(self): > self.a = 1 > > class cl2(cl1): > def __init__(self): > self.b = 2 > >But in such a way that cl2 instances ha