On May 9, 11:33 am, Bjoern Schliessmann <usenet-
[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] 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__()
>         # [...]
>


Delegating to an ancestor class by
calling an unbound method is fine as
long as one remembers to pass an instance
as the first argument.  So, this means:

    shortList.setList(self)

and

  shortList.__init__(self)

for the examples above.

--
Regards,
Steven


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to