A REALLY COOL PYTHON FEATURE:

Christian Tismer tismer at tismer.com
Thu May 11 16:12:04 EDT 2000


Martijn Faassen wrote:
> 
> Courageous <jkraska1 at san.rr.com> wrote:
> 
> > While all the oldtimers here already know this, I thought
> > I might share something really cool with some of my newbie
> > peers.... :)
> 
> >>>> 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? It's a godawful pain
> > in the ass, let me tell you. And there it is, in all it's
> > glory:
> 
> > reduce ( lambda x, y: x+", "+y, somenames )
> 
> It's actually pretty easy in Python, too. :) (you think all this
> reducing and lambda-ing is *easy*?)

Yes, he is of this incredible kind.
The first thing he used was my continuation module,
with roughly no idea of Python.

impressed-ly y'rs - chris

-- 
Christian Tismer             :^)   <mailto:tismer at appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     where do you want to jump today?   http://www.stackless.com




More information about the Python-list mailing list