[Python-3000] generics [was: Discussions with no PEPs]

Tony Lownds tony at pagedna.com
Sat Mar 10 23:03:45 CET 2007


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  
lost:

->>> for k, g in groupby(enumerate(data), lambda (i,x):i-x):
+>>> for k, g in groupby(enumerate(data), lambda t:t[0]-t[1]):
...     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))
...


-Tony


More information about the Python-3000 mailing list