brownplt / lambda-py

Other
58 stars 10 forks source link

filter predicates are being ignored in list comprehensions #42

Closed amtriathlon closed 11 years ago

amtriathlon commented 11 years ago

The ifs clause is not included in PyComprehen, so list comprehensions doesn't filter anything, for example

[x for x in (1, 2, 3, 4) if x % 2 == 0]

gives

[1, 2, 3, 4] instead of [2, 4]