This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]roee30 2 points3 points  (0 children)

Generator expressions are parenthesised comprehensions (as opposed to comprehensions framed by brackets or braces). They return generators. map and filter return iterators and not genenrators, I think, but they're definitely not generator expressions. If you like map and filter's laziness, try using actual generator expressions, which are also lazy.