官术网_书友最值得收藏!

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.

主站蜘蛛池模板: 丰镇市| 渑池县| 祁东县| 沙河市| 香河县| 修水县| 如皋市| 安平县| 周至县| 云阳县| 惠州市| 监利县| 崇仁县| 小金县| 富平县| 泸定县| 永年县| 永川市| 平原县| 射阳县| 普安县| 富裕县| 夏邑县| 咸阳市| 乌兰察布市| 陇川县| 朝阳市| 淅川县| 辽中县| 东辽县| 固阳县| 梨树县| 特克斯县| 五大连池市| 南江县| 锦屏县| 蕲春县| 云和县| 齐齐哈尔市| 巴彦淖尔市| 临城县|