[Python-ideas] Rehabilating reduce (as "fold")

Joshua Landau joshua at landau.ws
Fri Jul 12 10:49:32 CEST 2013


On 12 July 2013 09:03, Andrew Barnert <abarnert at yahoo.com> wrote:
>>I'd personally be in favour of the notion of also allowing strings as the first argument, so you could instead write:
>
>>
>>    data = fold("+=", [], iterables)
>
>
> I like this idea, but only if it's added to other functions in the stdlib where it makes sense, and easy to add to new functions of your own.

Is there a use-case for that last part? It strikes me as equivalent to
messing with builtins, which is largely unliked.


More information about the Python-ideas mailing list