[Python-Dev] PEP 289 - Generator Expressions - Let's Move Forward

Greg Ewing greg at cosc.canterbury.ac.nz
Sun May 2 23:05:46 EDT 2004


Samuele Pedroni <pedronis at bluewin.ch>:

> "There should be one-- and preferably only one --obvious way to do
> it."  of course this is the case for generator expressions and list
> comprehsensions because they are separated by performance
> characteristics and somehow by the fact that one directly produces a
> list. I suspect that we have to learn to live with the fact that
> they are distinguished by (just) that, both a nuisance (sometimes
> people don't want to bother to choose) and a feature.

I just had a thought.

What if generator expressions were allowed *only* as a
parameter to a function call?

Would that help avoid leading people into the trap of
using them where they're not appropriate?

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+



More information about the Python-Dev mailing list