Lambda or functools.partial for deferred function evaluation? [duplicate]
问题 This question already has answers here : Python: Why is functools.partial necessary? (6 answers) Closed 5 years ago . Let's say we have a basic function: def basic(arg): print arg We need to defer the evaluation of this function in another function. I am thinking about 2 possible ways: Using lambdas: def another(arg): return lambda: basic(arg) Using functools.partial from functools import partial def another(arg): return partial(basic, arg) Which of these approaches is preferred and why? Is