[Python-ideas] Parenthesized Compound With Statement

David Mertz mertz at gnosis.cx
Wed Jul 3 19:43:31 CEST 2013


This looks good... EXCEPT:

On Wed, Jul 3, 2013 at 9:56 AM, Ron Adam <ron3200 at gmail.com> wrote:

> Use what obviously reads better.  This can happen when continuing
> expressions which contain tuples, or strings with backslashes.  Using what
> is not in the expression can help make the intention clearer.
>
> Use what takes less characters.  For an expression that span 2 lines, use
> a single backslash. For longer expressions spanning 4 or more lines
> parentheses are preferred.
>

FEWER characters!

Also "spanS 2 lines"


>
> For continued lines inside of function calls, and container literals,
> indenting the continued lines is enough in most cases.
>
> Sometimes adding a backslash within a container can make a continued line
> between many single line items stand out better. (*)
>
> (* There have been "silent" bugs where a comma was omitted in cases where
> some lines are continued and some aren't.)
>
>
-- 
Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130703/cb45c2ed/attachment.html>


More information about the Python-ideas mailing list