On 2017-06-13, Peter Otten <__pete...@web.de> wrote:

>> def edges(items): # where items is a non-empty iterator
>>     first = next(items)
>>     last = functools.reduce(sekond, items, first)
>>     return [first, last]
>> 
>> Of course, right?
>
> Yeah, reduce() is certainly the cherry on the itertools cake ;)

Is the optional initializer the only difference between
functools.reduce() and the builtin reduce()?

-- 
Grant Edwards               grant.b.edwards        Yow! I know th'MAMBO!!
                                  at               I have a TWO-TONE CHEMISTRY
                              gmail.com            SET!!

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to