Accumulate function in python
geremy condra
debatem1 at gmail.com
Tue Jul 27 06:54:07 EDT 2010
On Wed, Jul 21, 2010 at 8:17 AM, John Nagle <nagle at animats.com> wrote:
> On 7/19/2010 9:56 AM, dhruvbird wrote:
>>
>> On Jul 19, 9:12 pm, Brian Victor<homeusen... at brianhv.org> wrote:
>>>
>>> dhruvbird wrote:
>
>>> Having offered this, I don't recall ever seeing reduce used in real
>>> python code, and explicit iteration is almost always preferred.
>>
>> Yes, even I have noticed that reduce is a tad under-used function.
>
> Yes, I had a use case for it once, but it wasn't worth the trouble.
> "map" is often useful, but "reduce", not so much.
>
> Python isn't really a functional language. There's no bias toward
> functional solutions, lambdas aren't very general, and the performance
> isn't any better. Nor is any concurrency provided by "map" or "reduce".
> So there's no win in trying to develop cute one-liners.
Too bad about the lack of concurrency, would be many places where that
would be nice.
Geremy Condra
More information about the Python-list
mailing list