Python indentation revisited

Amazingly, the article on Python indentation I bashed out a year ago at the Manchester parallel programming workshop has become the most popular thing on this website. Even more than all the lovely night climbing stuff: it seems the 'net is an even stranger place than I thought! It's also been nice to have the occasional bit of fan mail about the article (and a "you're wrong" mail, which is fine, except that it really missed the point and got into a fight with the tabs-vs-spaces straw man).

Anyway, I was thinking about finally putting my head above the parapet and trying to suggest an explicit block ending scheme to the Python dev list, when I found this mail thread, the first of which which goes through all the same experiences and reaches exactly the same conclusions as I did some 13 years later. Blimey --- what a way to be behind the times! George Reynolds seems a fully sane individual in my view, of course, and even manages to mention the problem of using Python where indentation is inconvenient/impossible, or even where the program must be expressed on a single line: I have been considering adding this to my own article, if I could manage to do so without cluttering, but I'll now leave George as the definitive authority.

The pragmatic reason for this post (there is one, really) is that Guido van Rossum himself chips into the debate, and even provides the "pindent" script for converting (legally-indented) Python programs to an explicit block scheme and back. A shame that the suggestion that such a thing be included in the Python interpreter never came to anything... if it hadn't been for the ugly "comment end block", this could have changed the face of Python some 10+ years ago. Now, however, I think we're probably stuck with what we've got. Let's see if I can get up the courage to bring this issue up for Python 3000!


Comments powered by Disqus