allow line break at operators

Ian Kelly ian.g.kelly at gmail.com
Wed Aug 10 11:16:58 EDT 2011


On Wed, Aug 10, 2011 at 8:37 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
>> Without the parentheses, this is legal but (probably) useless; it
>> applies the unary + operator to the return value of those functions.
>> Putting the + at the end of the previous line at least prevents that,
>> since most unary operators bind to the operand on the right;
>
> Not so:
>
>>>> x = (42 + -
> ...     100)
>>>>
>>>> x
> -58

That is still binding to the operand on the "right" (i.e., the
sequentially later).  And it still does not cause the problem that
Chris was talking about, since without the parentheses that would be a
syntax error.  So I guess I'm not certain what exactly it is that
you're trying to demonstrate here.



More information about the Python-list mailing list