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

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Jun 3 00:18:53 CEST 2011


Guido van Rossum wrote:
> Bingo. That's why. (Though you are missing some colons in your examples. :-)
>> --Guido
>> On Thu, Jun 2, 2011 at 11:50 AM, Glenn Linderman <v+python at g.nevcal.com> wrote:
>>>One place a double indent is extremely nice is for lines that initiate a new
>>indentation, but are themselves continued:
>>>>if some_function(
>> Some,
>> Parameters,
>> To,
>> Pass,
>> )
>> If_True_Operations()

Another way to approach that is
if some_function(
 Some,
 Parameters,
 To,
 Pass,
 ):
 If_True_Operations()
i.e. indent the *body* one more place. This avoids the
jarriness of seeing an outdent that doesn't correspond
to the closing of a suite.
-- 
Greg


More information about the Python-Dev mailing list

AltStyle によって変換されたページ (->オリジナル) /