[FRPythoneers] iterator like inject:into to generating comma-separated list

Cameron Laird claird at starbase.neosoft.com
Tue Sep 17 09:51:20 MDT 2002


> From frpythoneers-admin at lists.community.tummy.com  Tue Sep 17 10:27:15 2002
> Delivered-To: mailman-lists.community.tummy.com-frpythoneers at lists.community.tummy.com
> From: Matt Boersma <matt at sprout.org>
> X-X-Sender: mboersma at samsara.kgbinternet.com
> To: frpythoneers at lists.community.tummy.com
> Subject: Re: [FRPythoneers] iterator like inject:into to generating
>  comma-separated list
> 		.
> 		.
> 		.
> > > On Mon, Sep 16, 2002 at 07:25:25PM -0500, Cameron Laird wrote:
> > > >I prefer
> > > >  string.join(map(str, list), ",") 
> > 
> > > Sure, but which one is the One True Way (tm)?  ;-)
> > > 		.
> > > 		.
> > > 		.
> > Ha!  I will incant the martellibot into our midst,
> > and he will vilify and revile your lambda.

> And Guido would discourage both map() and lambda.  His "Python 
> regrets" talk at 
> http://www.python.org/doc/essays/ppt/regrets/PythonRegrets.pdf mentions 
> both these as features he wishes he'd dropped, at least now that we have 
> list comprehensions.

> There's Usually More Than One OK Way To Do It?  Nah, bad acronym.
> 		.
> 		.
> 		.
I'm actually fond of map and lambda.  For those following
along at home, let's make clear what a list comprehension
offers:
  string.join([str(item) for item in list], '; ')
or
  ', '.join([str(element) for element in list])



More information about the FRPythoneers mailing list