Is Python a functional programming language?

Paul Rubin no.email at nospam.invalid
Mon May 10 14:00:57 EDT 2010


Samuel Williams <space.ship.traveller at gmail.com> writes:
> Is Python a functional programming language?

It supports some aspects of functional programming but I wouldn't go as
far as to call it an FPL.  

> Is this a paradigm that is well supported by both the language syntax
> and the general programming APIs?

I'd say "somewhat supported" rather than "well supported".

> I heard that lambdas were limited to a single expression, and that
> other functional features were slated for removal in Python 3... is
> this the case or have I been misinformed?

I think, some features were slated for removal, but after some
discussion they were moved to libraries instead of eliminated
completely.

> Finally, even if Python supports functional features, is this a model
> that is used often in client/application code?

That's more a question of the programmers than the programs.  If you're
comfortable programming in functional style, that will tend to show
up in your python code.  There are some contortions you have to do though.

If your goal is to engage in functional programming, you're better off
using a language designed for that purpose.  Python is a pragmatic
language from an imperative tradition, that has some functional features
tacked on.  Python is pleasant for imperative programming while letting
you make some use of functional style.



More information about the Python-list mailing list