constructors in python

Peter Hansen peter at engcorp.com
Sun Apr 21 12:47:51 EDT 2002


eli li wrote:
> 
> Consider, we have two classes: one derived from other. In derived class c-or
> how is it possible to call the base c-or? Simple call base.__init__ (...)?

Assuming c-or means constructor:

[untested code]

class Base:
   def __init__(self):
       return

class Derived(Base):
   def __init__(self):
       Base.__init__(self)
       return


-Peter



More information about the Python-list mailing list