Better yet, use the convention implemented in my "pindent.py" program
that I posted a week ago. It uses block closers like this:
def foobar(a, b):
if a == b:
a = a+1
elif a < b:
b = b-1
if b > a: a = a-1
# end if
else:
print 'oops!'
# end if
# end def foobar
When called as "pindend -c", it takes a valid Python program as input
and outputs a version augmented with block-closing comments. When
called as "pindent -r" it assumes its input is a Python program with
block-closing comments but with its indentation messed up, and outputs
a properly indented version.
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>