Colon and underscores

Andrei Kulakov sill at optonline.net
Sat Jul 28 12:51:35 EDT 2001


On 28 Jul 2001 03:05:21 -0700, Igor <igor at arzamas.nnov.ru> wrote:
> It would be really nice to know the reasons behind some syntax
> features.
> 
> What is the real purpose of the colon ":" after each if, def, etc...
> Is it really required and cannot be made optional?

if something: do_something()

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

> 
> Why__ do __Python__ programs __need to __look__ like __swarms__ of
> __underscores ? Is it OK that one must dig in underscores instead of
> having a normal English word for private symbols, for example?

Because they are different from normal functions and variables - so they
should look different, too!

 - Andrei

-- 
Cymbaline: intelligent learning mp3 player - python, linux, console.
get it at: http://silmarill.org/cymbaline



More information about the Python-list mailing list