21 May
2011
21 May
'11
6:01 p.m.
On 5/20/2011 8:57 PM, Dan Baker wrote:
It seems odd that "for x in y if z" is allowed in comprehensions but not in a regular for loop.
Comprehensions are expressions and therefore need everything packed into them that is needed. For statements and if statement are statements and both can be followed in there suite with an many statements as needed, so there is no *need* to pack more than is necessary into the header line. Even doc strings, which are conceptually part of the header, were put down into the suite. -- Terry Jan Reedy