Skip to content

Instantly share code, notes, and snippets.

@eclecticmiraclecat
Created July 6, 2020 17:31
Show Gist options
  • Save eclecticmiraclecat/1efcd29fc3ab0abab329193158327683 to your computer and use it in GitHub Desktop.
Save eclecticmiraclecat/1efcd29fc3ab0abab329193158327683 to your computer and use it in GitHub Desktop.
>>> from functools import partial
>>>
>>> def foo(a,b):
... return a+b
...
>>> bar = partial(foo, a=1) # equivalent to: foo(a=1, b)
>>> bar(b=10)
11
>>> bar(a=101, b=10)
111
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment