Compare source code

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Fri Nov 5 06:36:14 EDT 2010


On Fri, 05 Nov 2010 11:21:57 +0100, Alain Ketterlin wrote:

> I really like "indentation as structure" (code is more compact and
> clearer), but I really hate that it relies on me putting the right
> spaces at the right place.

Er what? You really like indentation as structure, but you don't like 
putting in the indentation?


> I would love to be able to put, e.g., a
> period at the end of a line, to indicate that the next line is one level
> upper. Something like:
> 
> for i in ... :
>     for j in ... :
>         whatever(i,j).
>     .

How is that different from this?


for i in ... :
    for j in ... :
        whatever(i,j)


What's the point of the dots? Is that just to save you from having to hit 
shift-tab (or whatever your editor's decrease-indent command is)?


> No lost vertical space (except when I decide it), no ambiguity. 

What lost vertical space are you worried about?


> It looks
> to me like the exact opposite of ':'. End-of-line periods (or
> exclamation marks) would let tools reindent correctly in all cases. I
> don't think it conflicts with any other syntax.

for i in ... :
    for j in ... :
        n = 2.



-- 
Steven



More information about the Python-list mailing list