[Python-checkins] [Python-Dev] peps: Add rules for indenting continuation lines.

Barry Warsaw barry at python.org
Thu Jun 2 21:42:30 CEST 2011


On Jun 02, 2011, at 03:07 PM, R. David Murray wrote:

>Personally, I use "enough" indentation.  Sometimes that is a single
>indentation level, but sometimes it is more.  Two spaces is definitely
>right out, though :)
>
>The place where a single indentation level is *not* enough is when the
>line being indented is the statement starting a suite:
>
>    for x in long_function_name(
>        var_one, var_two, var_three):
>        print x
>
>    vs
>
>    for x in long_function_name(
>            var_one, var_two, var_three):
>        print x
>
>That's a case where I'd be likely to use even more than two indentation
>levels.  Usually, though, I try to refactor the statement so it fits
>on one line.

That's a recommendation I can definitely get on board with!  I do exactly the
same thing, although sometimes I use a comment between the compound statement
and the indented stanza.

-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-checkins/attachments/20110602/b8f4f558/attachment.pgp>


More information about the Python-checkins mailing list