Question about inheritance...

KraftDiner bobrien18 at yahoo.com
Sat Oct 22 20:54:51 EDT 2005


Well here is a rough sketch of my code...
This is giving my two problems.

1) TypeError: super() argument 1 must be type, not classobj
2) I want to be sure the the draw code calls the inherited classes
outline and not its own...

class Shape:
	def __init__(self):
		pass
	def render(self):
		print self.__class___
		self.outline()
	def outline(self):
		pass

class Rect(Shape):
	def __init__(self):
		super(self.__class__, self).__init__()
	def render(self):
		super(self.__class__, self).draw()
	def outline(self):
		print 'outline' + self.__class__




More information about the Python-list mailing list