micropython-lib/functools/test_partial.py

9 wiersze
136 B
Python

from functools import partial
def foo(x, y, prompt="result:"):
print(prompt, x + y)
f = partial(foo, 10, prompt="arg+10:")
f(20)