Guido sees the light: PEP 8 updated

Rustom Mody rustompmody at gmail.com
Mon Apr 18 23:54:40 EDT 2016


On Tuesday, April 19, 2016 at 9:00:12 AM UTC+5:30, Random832 wrote:
> On Mon, Apr 18, 2016, at 23:04, Rustom Mody wrote:
> > See elastic tabstops: http://nickgravgaard.com/elastic-tabstops/
> 
> >From there:
> >A column block is a run of uninterrupted vertically adjacent cells.
> 
> How's that going to handle this case:
> 
> if foo:             # comment that is aligned
>     do some stuff   # across multiple indent levels

Just tried it with the jar file¹ he supplies and it seems to work

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

The invariant of course is clear -- if the total no of tabs in the line
prior to the char are equal then all such lines line up

¹ yeah thats not very secure! And does not work with open java, works with
Sun/Oracle java



More information about the Python-list mailing list