Re: Allow multiline conditions and the like

2010-11-04 Thread Chris Rebert
On Thu, Nov 4, 2010 at 11:09 AM, Mark Wooding wrote: > Chris Rebert 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

Re: Allow multiline conditions and the like

2010-11-04 Thread Mark Wooding
Chris Rebert 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 function multiple

Re: Allow multiline conditions and the like

2010-11-01 Thread alex23
Chris Rebert 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: ... -- http://mail.python.org/mailman/listinfo/

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 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 > [...] >>

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 > parent

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 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 parenth

Re: Allow multiline conditions and the like

2010-11-01 Thread Ben Finney
Yingjie Lan 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 writes: > I would like to have comments after the li

Allow multiline conditions and the like

2010-10-31 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 (simila