GNU Info

Info Node: (python2.1-tut.info)Arbitrary Argument Lists

(python2.1-tut.info)Arbitrary Argument Lists


Next: Lambda Forms Prev: Keyword Arguments Up: More on Defining Functions
Enter node , (file) or (file)node

Arbitrary Argument Lists
------------------------

Finally, the least frequently used option is to specify that a function
can be called with an arbitrary number of arguments.  These arguments
will be wrapped up in a tuple.  Before the variable number of
arguments, zero or more normal arguments may occur.

     def fprintf(file, format, *args):
         file.write(format % args)


automatically generated by info2www version 1.2.2.9