Classes - instance/class, methods/members, inheritance and best practices

Rainer Deyke root at rainerdeyke.com
Wed May 2 11:43:41 EDT 2001


"Evan Jones" <EvanJ at eyron.com> wrote in message
news:mailman.988812244.30750.python-list at python.org...
> So what I have been doing is to create each class in a file of its own and
> add function definitions to that file to act as 'class' methods, and
> constructor chaining I have been doing by hand like:

You can call the base class's '__init__' directly:

class Super:
  def __init__(self):
    pass

class Sub(Super):
  def __init__(self):
    Super.__init__(self)



--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor





More information about the Python-list mailing list