Replace reduce with listcomprehension?

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Mon Aug 25 18:56:42 EDT 2008


Luis M. González, citing Guido:
> A. I'm not killing reduce() because I hate functional programming; I'm
> killing it because almost all code using reduce() is less readable
> than the same thing written out using a for loop and an accumulator
> variable.

(So reduce is now in itertools). Try to pry folds from the hands of
haskell programmers :-)
I think they think that folds are more clear than explicit loops...

Bye,
bearophile



More information about the Python-list mailing list