Newbie inheritance question.
marklists at mceahern.com
Sun Jan 16 09:26:39 EST 2005
> 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:
> class two(one):
> def __init__(self):
> print "two"
The problem is that you're not calling the parent class' __init__::
You can also use super() to do that, but I do that so rarely I forget
the syntax. Of course, that's no big deal, since::
is always to the rescue, but I'm lazy.
More information about the Python-list