Py3K idea: why not drop the colon?

skip at pobox.com skip at pobox.com
Fri Nov 10 15:06:29 CET 2006


    Neil> The colon's main purpose seems to be to allow one-liners:

    Neil> Easy to parse: if a < b: a += 1
    Neil> Hard to parse if a < b a += 1

No, as the note from Tim Peters referenced by Robert Kern pointed out
earlier in this thread, the ABC language designers found that
indentation-based block structure by itself wasn't enough to clue new users
in about the code structure.  Adding the colon at the end of the
if/while/for clause helped.

Skip




More information about the Python-list mailing list