Functional programming is a discipline, not a language feature. It is supported by a wide variety of languages, although those languages can make it more or less difficult to practice the discipline. python has a number of features that support functional programming, including map/reduce functions, partial application, and decorators.
The discipline of functional programming is defined by the statement: “No function call can have any side-effects”. Since IO is nothing but a side-effect it changes the state of the world, from the position of the next read in a file to the state of an output device it follows from this that no “pure functional” language can do IO. Haskellers distinguish “the runtime” from “the language” in an attempt to contradict this claim, but this hides the very clever way Haskell implements IO via monads to retain the power of a pure functional language in one that is not.
This article first appeared at DZone DevelopmentExploring Functional Python
本文开发（python）相关术语:python基础教程 python多线程 web开发工程师 软件开发工程师 软件开发流程