sum and strings

Paddy paddy3118 at netscape.net
Mon Aug 21 14:29:13 EDT 2006


Carl Banks wrote:
>
> and, you know, if you really want to concatenate strings with sum, you
> can
>
> class noopadd(object):
>     def __add__(self,other):
>         return other
> 
> sum(["abc","def","ghi"],noopadd())

;-)

- Pad.




More information about the Python-list mailing list