Why aren't colons optional?

Mark McEahern marklists at mceahern.com
Sat Jan 19 18:27:16 EST 2002


Edward K. Ream wrote:
> 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.

Because we're all masochists and love to inflict the pain of unnecessary
typing on ourselves.

Cheers,

// mark





More information about the Python-list mailing list