using lambda to print everything in a list
Ben Hutchings
ben.hutchings at roundpoint.com
Sun Apr 29 19:00:55 EDT 2001
scarblac at pino.selwerd.nl (Remco Gerlich) writes:
> Bjorn Pettersen <BPettersen at NAREX.com> wrote in comp.lang.python:
> > or
> >
> > def write(x):
> > print x
> >
> > map(lambda x: write(x), ['line one', 'line two'])
>
> Argh. We need UUOL (Useless Use Of Lambda) awards.
Quite. map and list comprehensions are meant for turning lists into
other lists, not for making lists of None while generating side-
effects. TMTOWTDI, BMOTAS (= but most of them are silly).
--
Any opinions expressed are my own and not necessarily those of Roundpoint.
More information about the Python-list
mailing list