RE: [Python-Dev] PEP 289 - Generator Expressions - Let's Move Forward
Tim Peters wrote:
# add a filter over the current pipe, and call that the new pipe pipe = (e for e in pipe if p(e))
This is a fairly convincing argument to me - that is something I do all the time with listcomps. Saves having to invent extra names. Tim Delaney
# add a filter over the current pipe, and call that the new pipe pipe = (e for e in pipe if p(e))
[Delaney, Timothy C (Timothy)]
This is a fairly convincing argument to me -
Except it's not an argument, it's just a six-month old example. I don't have an argument to make here. I've observed repeatedly that in all "reasonable" examples to date where the distinction makes a difference, early binding does better than late binding, but I still haven't dreamt up a "deep reason" for that. The arguments on both sides have been singularly uncompelling (to me, anyway).
that is something I do all the time with listcomps. Saves having to invent extra names.
I may have lost track, but I think the last plan Guido approved of here would actually evaluate the target of the leftmost "for" ("pipe" in the example above) immediately, leaving only "p" to get picked up later. It's impossible for me to guess how that might affect the things you do all the time with listcomps; also impossible for me to guess whether you'd do similar things with genexps. This issue has always been long on specious arguments and short on concrete examples. But that's OK -- we'll get the concrete examples, but after it's too late <wink>.
Tim Peters <tim.one@comcast.net>:
This issue has always been long on specious arguments and short on concrete examples. But that's OK -- we'll get the concrete examples, but after it's too late <wink>.
Maybe for a few releases they should have to be imported from __hypotheticalfuture__, a module whose contents are understood to be subject to merciless revision should they turn out to be a bad idea... Greg Ewing, Computer Science Dept, +--------------------------------------+ University of Canterbury, | A citizen of NewZealandCorp, a | Christchurch, New Zealand | wholly-owned subsidiary of USA Inc. | greg@cosc.canterbury.ac.nz +--------------------------------------+
On Tue, May 04, 2004, Greg Ewing wrote:
Tim Peters <tim.one@comcast.net>:
This issue has always been long on specious arguments and short on concrete examples. But that's OK -- we'll get the concrete examples, but after it's too late <wink>.
Maybe for a few releases they should have to be imported from __hypotheticalfuture__, a module whose contents are understood to be subject to merciless revision should they turn out to be a bad idea...
You're probably joking, but +1 from me. -- Aahz (aahz@pythoncraft.com) <*> http://www.pythoncraft.com/ Adopt A Process -- stop killing all your children!
participants (4)
-
Aahz
-
Delaney, Timothy C (Timothy)
-
Greg Ewing
-
Tim Peters