Parameter passing in python

Alex Martelli aleaxit at
Thu May 31 17:23:29 CEST 2001

"Laura Creighton" <lac at> wrote in message
news:mailman.991320527.18316.python-list at
> (posted by me, but this is from all of us here .... )
> ---------------------------------------
> This is what I have to do in my code when inheriting widgets:
> import Pmw
> class MyButtonBox(Pmw.ButtonBox)
>     def __init__(self, parent, **kw):
>        ...
>         apply(Pmw.ButtonBox.__init__, (self, parent), kw)
> Why am I required to do apply to be able to pass the keyword list?
> Some model of Pmw.ButtonBox.__init__(self, args) would be
> more readable.

In Python 2,
        Pmw.ButtonBox.__init__(self, parent, **kw)
is equivalent to the apply you have written.

Maybe the docs don't mention it because they go back
to pre-Python-2 times...?


More information about the Python-list mailing list