calling upper constructor

Oliver Rutherfurd fruhstuck at rutherfurd.net
Thu Jan 31 22:23:13 EST 2002


> -----Original Message-----
> From: python-list-admin at python.org 
> [mailto:python-list-admin at python.org] On Behalf Of Yura Ushakhow
> Sent: Thursday, January 31, 2002 10:01 PM
> To: python-list at python.org
> Subject: calling upper constructor
> 
> 
> Hello.
> 
> What do you do to call __init__ of an upper class?
> Like
> 
> class base:
>    def __init__(self):
>      a = 1
> class abc(base):
>    def __init__(self):
>      # how do I call base's init here?

explicitly, like so:

class abc(base):
	def __init__(self):
		base.__init__(self)

-Ollie

> Couldn't find it in the docs..
> Thanks in advance!
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 





More information about the Python-list mailing list