List mapping?

Robert Cragie rcc at
Fri Apr 14 12:07:46 EDT 2000

Remco Gerlich <scarblac-spamtrap at> wrote in message
news:slrn8fc4eu.1d0.scarblac-spamtrap at
| Robert Cragie wrote in comp.lang.python:
| > > Howcome you use reduce at all?
| > >
| > > Works fine with just doing
| > >
| > > tuplist = map(lambda x: (mylist[x], mylist[x+1]), range(0,
| > 2))
| >
| > Yep, that's neater. My excuse is that I've only been learning Python for
| > couple of weeks...
| In that case, forget you ever read something about map, lambda and reduce.
| Save it for later and code nice for loops now. 95% of the time, those
| only obfuscate code anyway.

'map' and 'reduce', perhaps. I think 'map' is syntactically neat for some
things, and not too confusing.
'lambda' is very useful, but, I think, quite confusing in its use, which is
partly why I did not see the simpler solution.

Robert Cragie

More information about the Python-list mailing list