Re: Newbie inheritance question.

2005-01-16 Thread Christophe Cavalaria
bwobbones wrote: > Hi all, > > I'm a java programmer struggling to come to terms with python - bear > with me! > > I'm trying to subclass a class, and I want to be able to see it's > attributes also. Here are my classes: > > two.py > * > from one import one > >

Re: Newbie inheritance question.

2005-01-16 Thread Jeremy Bowers
On Sun, 16 Jan 2005 22:08:13 +0800, bwobbones wrote: > Hi all, > > I'm a java programmer struggling to come to terms with python - bear > with me! Christophe already identified the problem, I wanted to address another Javaism in your code, for your educational benefit. Speaking "idiomaticall

Re: Newbie inheritance question.

2005-01-16 Thread Just
In article <[EMAIL PROTECTED]>, Ed Leafe <[EMAIL PROTECTED]> wrote: > On Jan 16, 2005, at 9:08 AM, bwobbones wrote: > > > class two(one): > >def __init__(self): > >print "two" > > You need to specifically call the superclass's __init__ here in order > for it to fire. Just add

Re: Newbie inheritance question.

2005-01-16 Thread Mark McEahern
bwobbones wrote: Hi all, I'm a java programmer struggling to come to terms with python - bear with me! Welcome! I'm trying to subclass a class, and I want to be able to see it's attributes also. Here are my classes: [snip] class two(one): def __init__(self): print "two" The problem i

Re: Newbie inheritance question.

2005-01-16 Thread Ed Leafe
On Jan 16, 2005, at 9:08 AM, bwobbones wrote: class two(one): def __init__(self): print "two" You need to specifically call the superclass's __init__ here in order for it to fire. Just add the line super(two, self).__init__() as the first line of the subclass's __init__. __

Newbie inheritance question.

2005-01-16 Thread bwobbones
Hi all, I'm a java programmer struggling to come to terms with python - bear with me! I'm trying to subclass a class, and I want to be able to see it's attributes also. Here are my classes: one.py: * class one: def __init__(self): print "one" self