Question about inheritance...

Kent Johnson kent37 at tds.net
Sat Oct 22 22:08:31 EDT 2005


KraftDiner wrote:
> This is what I've got so far:
> class Rect(Shape):
> 	def __init__(self):
> 		super(self.__class__, self).__init__()

Should be 
  super(Rect, self).__init__()

> 	def render(self):
> 		super(self.__class__, self).render()

ditto

In this example it doesn't make any difference but with a deeper inheritance hierachy it does. See
http://www.python.org/2.2.3/descrintro.html#cooperation

Kent



More information about the Python-list mailing list