Inheritance problem

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Wed May 9 14:33:49 EDT 2007


amidzic.branko at gmail.com wrote:

> class longList(shortList):
> 
>     def __init__(self):
> 
>         shortList.setList()
> 
>         self.setList()

Addition: Always call the base class __init__ in your constructor if
there exists one, i. e.

class longList(shortList)
    def __init__(self):
        shortlist.__init__()
        # [...]

Regards,


Björn

-- 
BOFH excuse #108:

The air conditioning water supply pipe ruptured over the machine
room




More information about the Python-list mailing list