Python's simplicity philosophy

Ville Vainio ville.spammehardvainio at spamtut.fi
Mon Nov 17 14:23:00 EST 2003


Donn Cave <donn at u.washington.edu> writes:

> > > Well, bah!  There are precious few constructs in this world that are
> > > clearer and more readable than
> > > 
> > >    reduce(add, seq)
> > 
> > I asked my non-programmer girlfriend what she thinks your construct
> > does - she didn't know. She immediately understood what sum(seq) does.

> not support any solution for that problem.)   It's hard to
> understand, just ask my girlfriend!  (Great.  By the way, what
> does she think of list comprehensions, generators, etc.?)

I was merely arguing that 'reduce' is not more readable or intuitive
than 'sum', which was the argument of OP. 

> Go ahead and get rid of reduce, that sounds like a good idea to me.

I don't think reduce should be altogether removed, it just shouldn't
be in stdlib. And neither should sum, btw. 

> The reason though is just that it's not very useful in the context
> of a language like Python, and it seems to confuse people who draw
> the conclusion that Python must be some kind of functional programming
> language.  This will be a wake-up call on that score.

I wouldn't mind Python getting more influence from functional realm,
as Python seems to me to be *the* hybrid language that can pull the FP
thing while still remaining practical and intuitive (and delightfully
non-academic).

-- 
Ville Vainio   http://www.students.tut.fi/~vainio24




More information about the Python-list mailing list