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

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.

主站蜘蛛池模板: 如皋市| 两当县| 黑山县| 通化市| 大同县| 内乡县| 团风县| 格尔木市| 浏阳市| 正宁县| 平远县| 建水县| 桃园县| 台江县| 兴和县| 镇江市| 胶州市| 即墨市| 公安县| 平舆县| 茂名市| 大厂| 宜良县| 高州市| 东丰县| 佛坪县| 剑阁县| 那坡县| 安远县| 赤城县| 娱乐| 弥勒县| 大丰市| 黄陵县| 阿坝县| 高要市| 且末县| 英吉沙县| 宜昌市| 镇雄县| 乡宁县|