On 12/30/05, sergio <[EMAIL PROTECTED]> wrote:
> this didn't work for me.. unless i added **kw instead of *kw..

Try it in the interpreter:

>>> def foo(a,b=2,*args,**kwargs):
...     print a,b,args,kwargs
...
>>> foo()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: foo() takes at least 1 argument (0 given)
>>> foo(3)
3 2 () {}
>>> foo(3,4)
3 4 () {}
>>> foo(3,4,5,6,7)
3 4 (5, 6, 7) {}
>>> foo(3,4,5,6,7,bar=8,baz=9)
3 4 (5, 6, 7) {'baz': 9, 'bar': 8}

Reply via email to