constructor chaining?

Mark Nenadov mnenadov at stclairc.on.ca
Tue Jul 24 08:31:41 EDT 2001


In article <6Sd77.62285$2V.13130988 at news3.rdc1.on.home.com>, "Daniel
Ellison" <daniel at syrinx.net> wrote:



> This is my first post here; I've just started looking into Python and so
> far like what I see.  To answer your question, you simply call Media's
> __init__ constructor from within Book's __init__ constructor:  class
> Book(Media):
>     def __init__(self):
>         Media.__init__(self)
>         ...

Awesome. Thank you very much, that was exactly what I was looking for.

-- 
~Mark Nenadov (author/editor for http://www.coffeecode.com)



More information about the Python-list mailing list