python partial
import functools def add(a, b): return a + b add(4, 2) 6 plus3 = functools.partial(add, 3) plus5 = functools.partial(add, 5) plus3(4) 7 plus3(7) 10 plus5(10) 15
import functools def add(a, b): return a + b add(4, 2) 6 plus3 = functools.partial(add, 3) plus5 = functools.partial(add, 5) plus3(4) 7 plus3(7) 10 plus5(10) 15