Passing on variable arguments

Alex Martelli aleax at aleax.it
Fri May 3 04:51:11 EDT 2002


Ralf Juengling wrote:

> how do I pass on a variable number of arguments. For instance:

In Python 2.0 and later, you use the * form in the call just as
in the def statement (in 1.5.2 you had to use builtin function
'apply').

>      def m(self, *args):
>         # do sth with *args
>         
>         # pass them on to superclass method
>         B.m(self, ????)

    B.m(self, *args)

assuming you want to pass ALL of args to B, of course.


Alex




More information about the Python-list mailing list