Why aren't colons optional?

Peter Hansen peter at engcorp.com
Sun Jan 20 17:21:01 EST 2002


"Edward K. Ream" wrote:
> 
> As to readability. Colons following def, if, etc., no more add to
> readability than do trailing semicolons.  The only syntax error I
> regularly make is to forget a trailing colon. 

Oddly enough, I never forget them anywhere except on 'else'.
And only when I type the else as part of the original code,
never when I add it later.  Must be something in my brain
about using the colon once per chunk of code, and I tend to 
think of if/else as a single blob when I add it the first time.



More information about the Python-list mailing list