Created
July 6, 2020 17:31
-
-
Save eclecticmiraclecat/1efcd29fc3ab0abab329193158327683 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> 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