Suggestion for impriving list comprehensions

Neil Schemenauer nas at python.ca
Fri Jul 27 21:05:02 EDT 2001


Tim Peters wrote:
...
>     for x in whatever:
> 
> magically applies iter() to whatever under the covers (nothing off there),
> but if "whatever" is a generator(-function), iter(whatever) is an error.

Huh?  Why would you want to iterate over the function itself?

  Neil




More information about the Python-list mailing list