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