[Tutor] Need help with using methods in a base class

Kent Johnson kent37 at tds.net
Mon Sep 8 16:54:03 CEST 2008


On Mon, Sep 8, 2008 at 9:21 AM, Roy Khristopher Bayot
<roybayot at gmail.com> wrote:
> Hi. It worked.

:-)

>>>> class LightsHandle(Parallel):
> ...     def __init__(self):
> ...             Parallel.__init__(self)
> ...     def __del__(self):
> ...             Parallel.__del__(self)

These two methods are not needed. If you omit them, the base class
methods will be called by default. You only need a subclass __init__()
method if it is doing initialization specific to the subclass.

It is very rare to define a __del__() method at all.

Kent


More information about the Tutor mailing list