Why aren't colons optional?
Edward K. Ream
edream at tds.net
Sun Jan 20 06:30:15 EST 2002
> Why are colons required after def, elif, else, except, finally, for, if,
> try and while? One would think the colon would be optional when the
> colon is followed by a newline.
Thanks to all who replied. To summarize the responses: This is not a
parser issue; apparently Guido believes colons increase readability.
Also, making trailing colons optional would impact many tools.
I am unconvinced, and I'm not going to press the issue. A workaround
for me may be to have Leo's auto-indenter increase indentation after
colons; missing trailing colons would then be more readily apparent as I
type.
Edward
--------------------------------------------------------------------
Edward K. Ream email: edream at tds.net
Leo: Literate Editor with Outlines
Leo: http://personalpages.tds.net/~edream/front.html
--------------------------------------------------------------------
More information about the Python-list
mailing list