PEP 289: Generator Expressions (please comment)

Raymond Hettinger vze4rx4y at verizon.net
Thu Oct 23 19:05:32 EDT 2003


[Rainer Deyke]
> At the very least, it would require parentheses if you want to create a list
> containing exactly one such generator.
>
> [(x for x in y)] # List containing generator
> [x for x in y]   # List comprehension

Yes, that's what the pep call for.


Raymond Hettinger






More information about the Python-list mailing list