python newbie: some surprises

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Fri May 9 02:22:37 EDT 2008


En Fri, 09 May 2008 01:47:49 -0300, Yves Dorfsman <yves at zioup.com>  
escribió:

> I see the point of the OP. Couldn't the new-line be used as an  
> equivalent of   ':', for example, do you find this difficult to read:
>
> if a == 3
>    do_something()
>
>
> if a == 3: do_something()
>
>
> And surely, it should be easy to parse by the compiler.

Yes, it could be done, there are no technical reasons to always force to  
use ":". But AFAIK the main reasons to keep ":" are internal consistency  
(an inner block always starts with ":"; incidentally, that's easier to  
handle for editors) and legibility (the ":" stands for itself and has a  
meaning)

-- 
Gabriel Genellina




More information about the Python-list mailing list