Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
TIL py3 partials don't mind multiple values for arguments
>>> def f(a, b):
... return a, b
...
# py27
>>> partial(f, b=1)(1, 2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: f() got multiple values for keyword argument 'b'
# py37
>>> partial(f, b=1)(a=1, b=2)
(1, 2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment