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 thefunctools.partial
function, implement currying. We'll save this forChapter 10,The Functools Module.