How to call functions with list and keyword arguments?

Robin Munn rmunn at pobox.com
Sat Nov 29 12:06:51 EST 2003


John Z. Smith <jzsmith at optonline.net> wrote:
> Thanks. I didn't event know that's legal syntax. Just checked the tutorial
> and reference
> manual but didn't find it. Could you point me to it? Thanks again.

Looking through the manual myself, it's a little hard to find. The tutorial
mentions the *args syntax in section 4.7.4:

    http://www.python.org/doc/current/tut/node6.html#SECTION006740000000000000000

but never mentions the **kwargs syntax at all that I could find. I believe
the tutorial could stand to be updated in that respect, maybe by expanding
section 4.7.4. If the *args syntax is in there, **kwargs should be also.

The language reference has mentions the syntax in the section on callable
objects, 5.3.4:

    http://www.python.org/doc/current/ref/calls.html

And finally, the extended call syntax is mentioned in the description of the
builtin function apply(), as the reason why apply() is now deprecated:

    http://www.python.org/doc/current/lib/built-in-funcs.html

-- 
Robin Munn
rmunn at pobox.com




More information about the Python-list mailing list