"Collapsing" a list into a list of changes

Steven Bethard steven.bethard at gmail.com
Mon Feb 7 13:25:59 EST 2005


Francis Girard wrote:
> I'm very sorry that there is no good use case for the "reduce" function in 
> Python, like Peter Otten pretends. That's an otherwise very useful tool for 
> many use cases. At least on paper. 

Clarity aside[1], can you give an example of where reduce is as 
efficient as the eqivalent loop in Python?

Steve

[1] I generally find most reduce solutions much harder to read, but 
we'll set aside my personal limitations for the moment. ;)



More information about the Python-list mailing list