foldr function in Python

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Fri Nov 23 05:58:19 EST 2007


On Fri, 23 Nov 2007 09:31:06 +0000, Marc 'BlackJack' Rintsch wrote:

> Of course it's a silly example because the "pythonic" way to define
> `comma_separate()` is::
> 
>  comma_separate = ','.join

Except that join only works with strings, and reduce/foldr can work on 
anything.


-- 
Steven.



More information about the Python-list mailing list