Suggestion: add "end" as a keyword for marking end of blocks

Why not do just that?

i = 0
while < 100:
    if i % 2 == 0:
        i *= 2
        print(i)
    # end

    i += 1
# end

Or similarly, just define end to be some dummy value:

end = "end"

i = 0
while < 100:
    if i % 2 == 0:
        i *= 2
        print(i)
    end

    i += 1
end

It seems that either of these would give you the code readability effect you want, without requiring you to wait for a PEP to be accepted and Python parsing tools to be updated.

5 Likes