Python's simplicity philosophy

Michael T. Babcock mbabcock at
Wed Nov 12 18:01:00 CET 2003

On Wed, Nov 12, 2003 at 08:28:29AM +0000, Robin Becker wrote:
> sequence.sum()
> sequence.reduce(operator.add[,init])
> sequence.filter(func) etc etc
> That would make these frighteningly incomprehensible ;)
> concepts seem less like functional programming. Personally I wouldn't
> like that to happen.

I'm hoping you were being sarcastic ... but I get the feeling you aren't.

Why, pray-tell, would you want an OO program to do:

results = [ func(x) for x in sequence ]

... instead of ...

results = ??

I can understand if you're writing highly LISP-like Python (see IBM's
articles on functional programming with Python for example).  However, I
don't see the 'harm' in offering functional methods to lists/arrays.

Looking at this code I wrote today:

    matches = [ get_matches(file) for file in duplicates ]
    todelete = [ get_oldest(files) for files in matches ]

... would end up being ...

    matches =
    todelete =

... or better ...

    todelete =

... and I somewhat like that as I look at it.
Michael T. Babcock
CTO, FibreSpeed Ltd.     (Hosting, Security, Consultation, Database, etc)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 671 bytes
Desc: not available
URL: <>

More information about the Python-list mailing list