consider the following:
from functools import partial
def add(a, b, c):
return 100 * a + 10 * b + c
add_part = partial(add, c = 2, b = 1)
add_part(3)
312
Works fine. However:
def foo(x, y, z):
return x+y+z
bar = partial(foo, y=3)
bar(1, 2)
barfs:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: foo() got multiple values for argument 'y'
Obviously I am missing something obvious, but what?