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

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.

主站蜘蛛池模板: 韩城市| 大宁县| 沙洋县| 滦南县| 宜良县| 驻马店市| 三河市| 连州市| 乌拉特中旗| 武义县| 南投县| 亚东县| 长春市| 蕲春县| 开化县| 宁津县| 泌阳县| 田阳县| 紫阳县| 吴旗县| 晴隆县| 贡嘎县| 高台县| 温州市| 姜堰市| 福州市| 南召县| 海丰县| 莱州市| 手机| 丰台区| 泾阳县| 隆回县| 襄樊市| 方正县| 库尔勒市| 马山县| 获嘉县| 赣榆县| 博客| 武穴市|