[Python-ideas] allow line break at operators

Devin Jeanpierre jeanpierreda at gmail.com
Thu Aug 11 15:24:34 EDT 2011


Javascript also lets you break lines. For example, this does what you want:

    return 1
        + 5

Whereas this does not

    return
        1 + 5

Of course, Python would have no such problem, because you could make both
cases unambiguous due to the indent.

Devin

On Thu, Aug 11, 2011 at 3:17 PM, Paul Colomiets <paul at colomiets.name> wrote:

> Hi Matt,
>
> On Thu, Aug 11, 2011 at 5:28 PM, Matt Joiner <anacrolix at gmail.com> wrote:
> > +0.5
> >
> > The "trailing \" workaround is nonobvious. Wrapping in () is noisy and
> > already heavily used by other syntactical structures. Since a final
> > ':' is needed anyway, i think this would be great.
> >
> > if a
> >  and b
> >  or c:
> >  do stuff()
> >
> If you really think so, try writing some coffeescript (remember to
> obey 79 chars limit). Coffeescript is amasing, but it lacks
> strictness of python. So you really don't know how to break line,
> and it really takes time to figure out right way each time you need
> it.
>
> --
> Paul
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110811/4998b835/attachment.html>


More information about the Python-list mailing list