Guido sees the light: PEP 8 updated

Random832 random832 at fastmail.com
Tue Apr 19 00:11:03 EDT 2016


On Mon, Apr 18, 2016, at 23:54, Rustom Mody wrote:
> Start no tabs:
> if foo# comment that is aligned
> do some stuff# across multiple indent levels 
> 
> Add tabs as leading indents with second line indented 1 tab more
> (showing tabs as |)
> |if foo# comment that is aligned
> ||do some stuff# across multiple indent levels 
>
> Indent the first comment with 2 tabs
> At this point the first comment is/shows lefter than the second
> 
> Indent the second with 1 tab -- the two #es now line up

Yeah but now the second line of code is to the right of the whole first
line of code. "if foo" must have been too short to illustrate it (it's
long enough if a tab is four spaces, but I guess it's longer in the
sample), but I assumed you would get the concept of what I was saying
and try putting something longer there or try extending the comments in
the C code the sample preloads.

Like, it ends up looking like this:

if foo("what if it's a much longer condition"):                # comment
                                                 do something  #
                                                 comment2

There's no way to get this:

if foo("what if it's a much longer condition"):  # comment
    do something                                 # comment2



More information about the Python-list mailing list