On 13/02/13 22:46, Xavier Morel wrote: > On 2013-02-13, at 12:37 , Steven D'Aprano wrote: >> >> # even less obvious than sum >> map(operator.add, array) > > That one does not work, it'll try to call the binary `add` with each > item of the array when the map iterator is reified, erroring out. > > functools.reduce(operator.add, array, '') > > would work though, it's an other way to spell `sum` without the > string prohibition. Oops, you are right of course, I was thinking reduce but it came out map. Thanks for the correction. -- Steven
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4