Em Sáb, 2006-02-11 às 20:16 -0800, Raymond Hettinger escreveu:
> Both work just fine. It's a personal choice when to use map() and when
> to use a list comprehension. Since many itertools have the flavor of
> map/filter, its use is not out of place in the itertools docs.
I know both work in the
[Felipe Almeida Lessa]
> IMHO, on http://www.python.org/doc/current/lib/itertools-example.html ,
> shouldn't the part
>
> >>> for k, g in groupby(enumerate(data), lambda (i,x):i-x):
> ... print map(operator.itemgetter(1), g)
>
> be
>
> >>> for k, g in groupby(enumerate(data), lambda (i, x): i-x