[Tutor] Creating subclasses (newbie)

Adam adam at monkeez.org
Mon Jun 21 04:06:35 EDT 2004


I have a subclass I want to create - my intuition told me
that it would be done like this:

class MainClass:
	class SubClass:
		code...
	subclassinstance = SubClass()
mainclassinstance = MainClass()

But it seems that this isn't going to work. I'm reading a
couple of Python books, but they don't seem to cover this
topic very well (I don't see any coding examples).

What is the best way of creating (coding) subclasses?

Thanks in advance. 

Adam



More information about the Tutor mailing list