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

Cameron Laird claird at starbase.neosoft.com
Tue Sep 17 10:13:12 MDT 2002


> From frpythoneers-admin at lists.community.tummy.com  Tue Sep 17 11:04:15 2002
> Delivered-To: mailman-lists.community.tummy.com-frpythoneers at lists.community.tummy.com
> From: "Ben Harding" <blh at hydrosphere.com>
> 		.
> 		.
> > 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])

> I _am_ following along at home.  I had no idea that I already knew 
> what a list comprehension was, so this was helpful.  But, I wonder 
> why the distinction between "item" and "element" in these two 
> statements.
> 		.
> 		.
> 		.
Redaction error.  I carelessly introduced a distraction.
Perhaps these are better models for the list comprehension
approach:
  string.join([str(i) for i in list], ',')
and
  ','.join([str(i) for i in list])

I apologize for the confusion.



More information about the FRPythoneers mailing list