[docs] PEP8 conformance regarding the "Idioms and Anti-Idioms in Python" page

Matthew Lakier latias100 at gmail.com
Sat Nov 3 02:30:12 CET 2012

This is nothing major, but I guess every bit helps.

Under the "Using Backslash to Continue Statements" section of
http://docs.python.org/2/howto/doanddont.html (also in the Python 3 docs),
the last two code samples:

value = foo.bar()['first'][0]*baz.quux(1, 2)[5:9] \
        + calculate_number(10, 20)*forbulate(500, 360)


value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9]
        + calculate_number(10, 20)*forbulate(500, 360))

have the operator after the line break instead of before, like:

value = (foo.bar()['first'][0]*baz.quux(1, 2)[5:9] +
         calculate_number(10, 20)*forbulate(500, 360))

It would be good if these code samples could be changed to have the
operator before the line break in order to conform with PEP8 ("The
preferred place to break around a binary operator is after the operator,
not before it.") and the rest of the documentation.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20121103/10f44dc8/attachment.html>

More information about the docs mailing list