[Python-ideas] filter-only list comps

Nick Coghlan ncoghlan at gmail.com
Thu Feb 25 14:45:13 CET 2010

Nick Coghlan wrote:
> spir wrote:
>> numbers if x%2==1] that confusingly repeats the item. Would there be
>> any parsing issue if we let down "<expression> for" when it does
>> nothing?
> Yes, there's a parsing problem:

Even aside from the interpreter parsing problem, there's actually a more
important human parsing problem. Without a filter call to imply
iteration, we want to retain the "for" keyword so human readers can
easily tell there is a loop involved in the construct.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-ideas mailing list