Allow multiline conditions and the like

Chris Rebert clp2 at rebertia.com
Mon Nov 1 04:22:15 EDT 2010


On Mon, Nov 1, 2010 at 12:51 AM, Steven D'Aprano
<steve-REMOVE-THIS at cybersource.com.au> wrote:
> On Sun, 31 Oct 2010 23:02:21 -0700, Yingjie Lan wrote:
>> Hi,
>>
>> 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
> [...]
>>    also, if we don't allow it, people just have to use
>> parenthesis around the expressions to make that happen.
>
> You say that like it's a bad thing.
>
> That is kind of like saying "We should allow people to speed through red
> traffic lights, because if we don't, they'll just wait for the light to
> turn green!". Er, yes, and the problem is?
>
> If you need a multi-line conditional, wrap it in parentheses.

Or, if possible, refactor the conditional into a function (call) so
it's no longer multiline in the first place.

Cheers,
Chris



More information about the Python-list mailing list