上QQ阅读APP看书,第一时间看更新
Lambdas and the lambda calculus
In a book on a purely functional programming language, it would be necessary to explain lambda calculus, and the technique invented by Haskell Curry that we call currying. Python, however, doesn't stick closely to this kind of lambda calculus. Functions are not curried to reduce them to single-argument lambda forms.
Python lambda forms are not restricted to single argument functions. They can have any number of arguments. They are restricted to a single expression, however.
We can, using the functools.partial function, implement currying. We'll save this for Chapter 10, The Functools Module.