Python **kwargs ?

Bruno Desthuilliers bruno.42.desthuilliers at wtf.websiteburo.oops.com
Wed Jan 31 12:29:04 EST 2007


johnny a écrit :
> What is **kwargs mean in python?  When you put double **, does it mean
> passing by reference?

Nope.

Python as support for both positional (*args) and named (**kwargs) varargs.

> For example:
> def redirect_to(request, url, **kwargs):

means that redirect_to expect a positional 'request' arg, a positional 
'url' argument, and any other arbitrary named arguments.

You'll find all relevant doc in the FineManual(tm):
http://www.python.org/doc/current/tut/node6.html#SECTION006720000000000000000

HTH




More information about the Python-list mailing list