A Suggestion for Python Colon Syntax

William Djaja Tjokroaminata billtj at z.glue.umd.edu
Thu Dec 21 16:09:47 EST 2000


I saw many replies that give the reasons why the colons are
*needed*.  My suggestion is to make it *optional*, like the semicolon at
the end of statements.

Yes, for people who cares about making it easier to read for newbies, they
can always put colons.  Yes, for people who use emacs to automatically
indent the next line, they can put colons too.

However, as Guido wrote that he wanted an ABC that appeals to Unix/C
users, one of the unix designs is its minimalist style in terms of command
or syntax.  To me, I like Python because when I want to create a function
I just write def as the first keyword and the rest follows, without much
punctuation.  However, from time to time, the colons always make me come
back to fix them.  For me personally, deleting the colons do not change
the readability of the code at all.  Probably the study should be
conducted not only on the newbies, but also on people who have programmed
for a long time.  Besides, fewer keystrokes are always better, in my
opinion.  Unix C shell does not require colons for the clauses.

Therefore, my suggestion is really not to remove the colons, but to make
them optional.  I want opinion of you who have programmed for a long time
whether there will be some harms if the colons are made optional.  If not,
probably someone can tell me how I can forward this suggestion to the core
Python development team?

Regards,

Bill



More information about the Python-list mailing list