3 ms·
Python requires all args following a keyword arg to be keyword args: >>> def foo(a=0, b=1, c=2): return [a, b, c]; ... >>> foo(34) [34, 1, 2] >>> fo
by akkartik 15y ago
Python requires all args following a keyword arg to be keyword args:
>>> def foo(a=0, b=1, c=2): return [a, b, c];
...
>>> foo(34)
[34, 1, 2]
>>> foo(b=34)
[0, 34, 2]
>>> foo(b=34, 35)
File "<stdin>", line 1
SyntaxError: non-keyword arg after keyword arg
I chose instead to simply bind args by position after keyword args have been taken:
wart> (foo :b 34 35)
(35 34 2)