Creating subclassess (newbie)

Adam adamc at linuxmail.org
Mon Jun 21 10:38:54 EDT 2004


I have tried to send this to the tutor mailing list, but it
seems to be down at the moment. 

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?
Alternatively, is there any good documentation on the web
for doing this? 

Thanks in advance. 

Adam



More information about the Python-list mailing list