Python Rocks! - get rid of colons

Michael Hudson mwh21 at cam.ac.uk
Wed Jan 19 06:55:18 EST 2000


Sposhua <sposhua at my.pc> writes:

> I'm one of the "prefers indentation to {}" ppl, and I'd just like to
> add: whe the heck do we need colons (:) at the end of if's 'n loops
> anyway? The only loss I see is to these 1-liners:
> 
> if a==b: eric=idle
> 
> What's wrong with:
> 
> if a==b
> 	eric=idle

I should probably wait for someone more authoritative, but I seem to
recall that this is the result of research done at CWI before Python
was invented; people find it easier to read with the colons.

I'm not sure what `people' they used, but I think I agree with them.
 
> (oh, and wouln't it make life easier to change == to = and let
> python work out when it is assingment and when it is comparison?)

What so the string `a = 1' would mean different things if it was 

if <here>:
    pass

than if it was

if 1:
    <here>

? No thanks, that sounds like ... perl.

Not going to happen, anyway.

Cheers,
Michael



More information about the Python-list mailing list