python idioms: (was: a really cool python feature)

Grant Griffin g2 at seebelow.org
Fri May 12 03:20:36 EDT 2000


Andrew Dalke wrote:
> 
> Courageous wrote:
> >>>> somenames = ["fred", "barney", "wilma", "betty"]
> >>>> reallycool = reduce ( lambda x, y: x+", "+y, somenames )
> >>>> reallycool
> >'fred, barney, wilma, betty'
> >>>>
> >
> >Check that out. Do you know what a royal pain in the ass
> >it is in most languages to do this?
> 
> BTW, the usual way to do that is
> 
>   string.join(somenames, ", ")
> 

Forgive a possible newbie FAQ, but is there a page of Python idoms like
this?

sorry-for-not-searching-in-advance-ly y'rs,

=g2
-- 
_____________________________________________________________________

Grant R. Griffin                                       g2 at dspguru.com
Publisher of dspGuru                           http://www.dspguru.com
Iowegian International Corporation	      http://www.iowegian.com



More information about the Python-list mailing list