Py3K idea: why not drop the colon?

Michael Hobbs mike at
Thu Nov 9 17:16:53 CET 2006

Can anyone find a flaw with this change in syntax?

Instead of dividing a compound statement with a colon, why not divide it 
on a newline? For example, the colon could be dropped from this statement:
    if self.hungry:
    if self.hungry

Python is already sensitive to whitespace and the newline anyway, so why 
not put it to good use? For example, Python rejects this statement 
because of the newline present:
    if self.hungry or
You need to use the backslash to continue the expression on the next line:
    if self.hungry or \
The colon that divides the statement therefore seems redundant. The 
colon could continue to be used for single-line statements:
    if self.hungry:

I think the colon could be omitted from every type of compound 
statement: 'if', 'for', 'def', 'class', whatever. Am I missing anything?

- Mike

More information about the Python-list mailing list