Cameron Simpson <[EMAIL PROTECTED]> writes:

> A good coder will present things clearly. For trivial stuff the one
> line form may be fine, and for longer stuff then this:
> 
>   y = some thing or other \
>       if x \
>       else something_else

Parentheses are usually more robust for multi-line, where possible:

    foo = (bar
        if some_condition()
        else baz)

The lines can more easily be edited and rearranged without fiddling
with backslashes at the end of every line. (For even more robustness
at the cost of space, separate the parentheses so they're on separate
lines from what they enclose.)

It also addresses the original poster's complaint that there's no
early signal of the compound nature of the expression: the opening
parenthesis signals this.

-- 
 \     “It is far better to grasp the universe as it really is than to |
  `\    persist in delusion, however satisfying and reassuring.” —Carl |
_o__)                                                            Sagan |
Ben Finney
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to