Allow multiline conditions and the like

Yingjie Lan lanyjie at
Mon Nov 1 07:02:21 CET 2010


This is a mini-proposal I piggy-tailed in the other topic:

Allow the conditions in the if-, elif-, while-, for-, and
with-clauses to span multiple lines without using a backlalsh
at the end of a line, 
just like when you specify literal lists, tuples, dicts, etc.
across multiple lines (similar to comprehensions too).

My reasons:

   because they all must end with a required colon ':',
so nobody will mistake it. 

   also, if we don't allow it, people just have to use
parenthesis around the expressions to make that happen.

Just a half-baked idea, appreciate all comments.



More information about the Python-list mailing list