[Python-3000] generics [was: Discussions with no PEPs]
Guido van Rossum
guido at python.org
Mon Mar 12 19:09:42 CET 2007
Actually, I like the version with t-t better. This is supposed
to be an exposition about groupby. Working out how it works, the
version with count() seems to take more effort.
But thanks for doing this! Is it done, apart from this nit? Then I'll
check it in.
On 3/10/07, Tony Lownds <tony at pagedna.com> wrote:
> On Mar 9, 2007, at 2:35 PM, Guido van Rossum wrote:
> > On 3/9/07, Tony Lownds <tony at pagedna.com> wrote:
> >> By the way, I would like to work on either removing tuple parameters
> >> in 3.0
> > That would be great!
> I've posted a patch removing tuple parameters as #1678060.
> There was one case in itertools tests/docs where IMO readability was
> ->>> for k, g in groupby(enumerate(data), lambda (i,x):i-x):
> +>>> for k, g in groupby(enumerate(data), lambda t:t-t):
> ... print(map(operator.itemgetter(1), g))
> Is it OK to replace this with:
> >>> for k, g in groupby(data, lambda i, c=count(): c.next()-i):
> ... print(list(g))
> Python-3000 mailing list
> Python-3000 at python.org
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-3000