[Python-3000] PEP 3125 -- a modest proposal

Andrew Koenig ark at acm.org
Tue May 8 15:08:51 CEST 2007

> Too dangerous.  The most common Python syntax error (by far, even for
> experienced users) is omission of a colon.  If the missing colon starts
> to have its own special meaning, that would not be a good thing.

It's not special -- omitting it would have exactly the same effect as
omitting a colon does today in a single-line statement.  That is, today you
can write

	if x < y: x = y

or you can forget the colon and write

	if x < y x = y

and (usually) be diagnosed by the compiler.  My proposal would make

	if x < y:
		x = y


	if x < y
		x = y

have the same meanings as (respectively) the first two examples above, so
the fourth example would still be diagnosed as an error for the same reason.

More information about the Python-3000 mailing list