Creating subclassess (newbie)

Peter Hansen peter at
Mon Jun 21 16:53:45 CEST 2004

Adam wrote:

> 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()

Have you followed through the tutorial in the documentation?
The section on classes covers inheritance in a basic way.


More information about the Python-list mailing list