[Python-ideas] Minor tweak to PEP 8?

Barry Warsaw barry at python.org
Thu Jun 2 21:00:31 CEST 2011

On Jun 02, 2011, at 11:11 AM, Guido van Rossum wrote:

>FYI, I've submitted this change to PEP 8, with the help of a draft
>patch by Steven Klass.

Thanks Guido.  This is probably the right mailing list to follow up to (ignore
my python-dev followup to the -checkins message).

I agree with the change, except for the recommendation to double-indent.  Yes,
double-indent does look better with Google's 2-space indentation level rule,
but it looks excessive (to my eyes anyway) with a 4-space rule.  One
indentation level looks fine.  I posted some examples to python-dev.

Is it worth softening the PEP 8 recommendation on double-indents?


>On Wed, May 11, 2011 at 7:23 AM, Guido van Rossum <guido-+ZN9ApsXKcEdnm+yROfE0A at public.gmane.org> wrote:
>> At Google we use the following rule (from
>> http://google-styleguide.googlecode.com/svn/trunk/pyguide.html#Indentation):
>> Yes:  # Aligned with opening delimiter
>>       foo = long_function_name(var_one, var_two,
>>                                var_three, var_four)
>>       # 4-space hanging indent; nothing on first line
>>       foo = long_function_name(
>>           var_one, var_two, var_three,
>>           var_four)
>> No:   # Stuff on first line forbidden
>>       foo = long_function_name(var_one, var_two,
>>           var_three, var_four)
>>       # 2-space hanging indent forbidden
>>       foo = long_function_name(
>>         var_one, var_two, var_three,
>>         var_four)
>> I propose we somehow incorporate these two allowed alternatives into PEP 8.
>> They both serve a purpose.
>> --
>> --Guido van Rossum (python.org/~guido)
-------------- 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-ideas/attachments/20110602/02ea76b3/attachment.pgp>

More information about the Python-ideas mailing list