Is Python a functional programming language?

Terry Reedy tjreedy at udel.edu
Tue May 11 14:13:19 EDT 2010


On 5/11/2010 7:11 AM, Lawrence D'Oliveiro wrote:
> In message<7xvdavd4bq.fsf at ruckus.brouhaha.com>, Paul Rubin wrote:
>
>> Python is a pragmatic language from an imperative tradition ...
>
> I thought the opposite of “functional” was “procedural”, not “imperative”.
> The opposite to the latter is “declarative”. But (nearly) all procedural
> languages also have declarative constructs, not just imperative ones
> (certainly Python does).

Python has only two: 'global' and now 'nonlocal'.
There are also two meta-declarations: the coding cookie (which 
would/will go away in an entirely unicode world) and future imports 
(which are effectively temporarily gone in 3.x until needed again).

Newbies sometimes trip over def and class being imperative (executable) 
statments rather than declarations.

Terry Jan Reedy






More information about the Python-list mailing list