A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-December/040655.html below:

[Python-Dev] Re: "groupby" iterator

[Python-Dev] Re: "groupby" iteratorPhillip J. Eby pje at telecommunity.com
Wed Dec 3 11:30:35 EST 2003
At 11:18 AM 12/3/03 -0500, Greg Ball wrote:
>Would it work to generalise generator expressions in the following way:
>
>(x[1] for x) == lambda x:x[1]
>(x.score for x) == lambda x: x.score
>(x+y for x,y) == lambda x,y: x+y
>(len(x) for x) == lambda x,len=len: len(x)  # roughly equivalent

-1.  It looks like a generator expression, but the semantics are way too 
different.  Unless you intended that it should be invoked with .next() 
rather than __call__, but then there's no way to pass the arguments.

(FWIW, my first reaction was, "Whoa!  Cool!", until I thought about how 
you'd actually have to use it.)


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4