Re: Allow multiline conditions and the like

2010-11-04 Thread Mark Wooding
Chris Rebert c...@rebertia.com writes: Or, if possible, refactor the conditional into a function (call) so it's no longer multiline in the first place. No! This /increases/ cognitive load for readers, because they have to deal with the indirection through the name. If you actually use the

Re: Allow multiline conditions and the like

2010-11-04 Thread Chris Rebert
On Thu, Nov 4, 2010 at 11:09 AM, Mark Wooding m...@distorted.org.uk wrote: Chris Rebert c...@rebertia.com writes: Or, if possible, refactor the conditional into a function (call) so it's no longer multiline in the first place. No!  This /increases/ cognitive load for readers, because they

Allow multiline conditions and the like

2010-11-01 Thread Yingjie Lan
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 without using a backlalsh at the end of a line, just like when you specify literal lists, tuples, dicts, etc. across multiple lines

Re: Allow multiline conditions and the like

2010-11-01 Thread Ben Finney
Yingjie Lan lany...@yahoo.com writes: 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, You can already do this with any expression: use parentheses. Yingjie Lan lany...@yahoo.com writes: I would

Re: Allow multiline conditions and the like

2010-11-01 Thread Lawrence D'Oliveiro
In message 874oc1ldo6@benfinney.id.au, Ben Finney wrote: Yingjie Lan lany...@yahoo.com writes: 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, You can already do this with any expression: use

Re: Allow multiline conditions and the like

2010-11-01 Thread Steven D'Aprano
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

Re: Allow multiline conditions and the like

2010-11-01 Thread Chris Rebert
On Mon, Nov 1, 2010 at 12:51 AM, Steven D'Aprano steve-remove-t...@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

Re: Allow multiline conditions and the like

2010-11-01 Thread alex23
Chris Rebert c...@rebertia.com wrote: Or, if possible, refactor the conditional into a function (call) so it's no longer multiline in the first place. Or even simpler, assign the condition result to a variable: a_b_positive = a 0 and b 0 if a_b_positive: ... --