generated comprehensions

Michael Gilfix mgilfix at eecs.tufts.edu
Tue May 14 02:49:02 EDT 2002


On Mon, May 13 @ 23:31, Garth T Kidd wrote:
> Has anyone tried to figure out a generator variant on list
> comprehensions? Should all list comprehensions return generators?

  .. or rather, why shouldn't they? Aren't generators much more memory
efficient? Perhaps someone could enlighten me on the downside of
generators since they seem to accomplish everything a pure iterator
can do but in a more memory efficient way.

               -- Mike

-- 
Michael Gilfix
mgilfix at eecs.tufts.edu

For my gpg public key:
http://www.eecs.tufts.edu/~mgilfix/contact.html





More information about the Python-list mailing list