allow line break at operators

Chris Angelico rosuav at gmail.com
Fri Aug 12 22:01:56 CEST 2011


On Fri, Aug 12, 2011 at 5:33 PM, Seebs <usenet-nospam at seebs.net> wrote:
> I've seen people in C do stuff like:
>
>        for (i = 0; i < N; ++i);
>                a[i] = 0;
>
> This is clearly a case where indentation matches intent, but doesn't match
> functionality, because C allows indentation to not-match functionality; this
> is the famous problem Python is solving.
>

There's several solutions to this. One is linting utilities that
detect unexpectedly-indented code, which is the concept that Python
took to the logical extent of syntactic errors. Another is (again
linting) to disallow a direct trailing semicolon; if you want an empty
body, you put whitespace before the semicolon.

But that wasn't your point, I realise :)

ChrisA



More information about the Python-list mailing list