Python **kwargs ?

Szabolcs Nagy nszabolcs at gmail.com
Wed Jan 31 14:25:28 EST 2007


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

here's a little example:

>>> def f(a, *args, **kw):
...     print 'a:',a
...     print 'args:',args
...     print 'kw:',kw
...
>>> f(1,2,3,x=4)
a: 1
args: (2, 3)
kw: {'x': 4}
>>> f(a=1,b=2,c=3)
a: 1
args: ()
kw: {'c': 3, 'b': 2}




More information about the Python-list mailing list