Python's simplicity philosophy

Jeremy Fincher tweedgeezer at hotmail.com
Tue Nov 11 17:23:48 EST 2003


Douglas Alan <nessus at mit.edu> wrote in message news:<lc4qxau8h7.fsf at gaffa.mit.edu>...
> Well, perhaps anything like "only one way to do it" should be removed
> from the mantra altogether, since people keep misquoting it in order
> to support their position of removing beautiful features like reduce()
> from the language.

I don't know what your definition of beautiful is, but reduce is the
equivalent of Haskell's foldl1, a function not even provided by most
of the other functional languages I know.  I can't see how someone
could consider it "beautiful" to include a rarely-used and
limited-extent fold and not provide the standard folds.

You want to make Python into a functional language?  Write a
functional module.  foldl, foldr, etc; basically a copy of the Haskell
List module.  That should give you a good start, and then you can use
such facilities to your heart's content.

Me?  I love functional programming, but in Python I'd much rather read
a for loop than a reduce or probably even a fold.  Horses for courses,
you know?

Jeremy




More information about the Python-list mailing list