Newbie inheritance question.

Ed Leafe ed at
Sun Jan 16 09:24:15 EST 2005

On Jan 16, 2005, at 9:08 AM, bwobbones wrote:

> class two(one):
>    def __init__(self):
>        print "two"

	You need to specifically call the superclass's __init__ here in order 
for it to fire. Just add the line

        super(two, self).__init__()

as the first line of the subclass's __init__.

  Ed Leafe

More information about the Python-list mailing list