Is Python a functional programming language?
Stefan Behnel
stefan_ml at behnel.de
Mon May 10 08:52:51 EDT 2010
Samuel Williams, 10.05.2010 14:24:
> Is Python a functional programming language?
No. Python is a multi-paradigm language. But it does have functions (and
methods) as first-class objects.
> Is this a paradigm that is well supported by both the language syntax
> and the general programming APIs?
I'd say so, but it certainly depends on what functional language features
you desire.
> I heard that lambdas were limited to a single expression
... which is a good thing. An expression in Python can do pretty complex
things already. Not allowing more puts a limit to code readability degradation.
> and that other
> functional features were slated for removal in Python 3... is this the
> case or have I been misinformed?
No such functionality has been removed in Py3, and in fact, several core
language features were adapted to make functional programming easier and
more efficient.
> Finally, even if Python supports functional features, is this a model
> that is used often in client/application code?
From my point of view, yes. But the beauty is that Python is
multi-paradigm, so you're not restricted to functional language features.
Stefan
More information about the Python-list
mailing list