Thursday, August 18, 2011

Passing Parameters 4 Ways at Once


>>> def foo(a,b,c,d): print a, b, c, d
...
>>> foo(1, *(2,), c=3, **{'d':4} )
1 2 3 4

No comments:

Post a Comment