[Python-Dev] [Python-checkins] peps: Add rules for indenting continuation lines.
barry at python.org
Fri Jun 3 00:15:58 CEST 2011
On Jun 02, 2011, at 12:57 PM, Glenn Linderman wrote:
>On 6/2/2011 12:01 PM, Guido van Rossum wrote:
>> Bingo. That's why. (Though you are missing some colons in your examples.:-)
>You operate as a good Python compiler :)
Actually, this is a key insight, which I just mentioned in a private response
to Steve. How about this for the rule:
If the hanging line ends in a colon, then double-indent (or "more-ly
indented") seems appropriate. If not, then a single indent is sufficient.
That handles cases like this, where double indent makes sense:
and these cases where a single indent is fine:
x = some_really_long_function_name(
d = dict(
Does that cover it?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 836 bytes
Desc: not available
More information about the Python-Dev