Colon and underscores

Neil Hodgson nhodgson at bigpond.net.au
Sun Jul 29 00:35:23 CEST 2001


Andrei Kulakov:

> Besides, editors detect that : and autoindent for you. Imagine for
instance
> that you are 5 levels of indentation to the right, if there were no colons
> you'd have to hit enter and then <tab> 5 times! No thanks :P

   Editors can also detect that you started the line with a structuring
keyword (if, def, ...) and indent. The colon is really only needed when you
want to place the body on the same line:

    if a: b = 1

   I'd be happy to see Python without the colons at the end of lines but its
no big deal.

   Neil






More information about the Python-list mailing list