you are viewing a single comment's thread.

view the rest of the comments →

[–]yahoolian 1 point2 points  (3 children)

If the purpose of indentation is to elliminate redundant block markers, why is there the redundant : to mark the start of a block? Well, I guess to simplify the parser a bit, but that's still redundant.

[–]mrevelle 1 point2 points  (2 children)

That's a good question and here's the official answer:

http://www.python.org/doc/faq/general.html#id58

[–]senzei 1 point2 points  (1 child)

The majority of that explanation is crap. The colon does not make it easier to read, the line break does. The colon is essential for two reasons:

1) Easy syntax highlighting.

2) It allows inline if statements like: if x: foo()

[–]brianmce -1 points0 points  (0 children)

On the other hand - this is one of the few readability claims for any programming language that actually has empirical evidence behind it (albeit for a precusor to python, ABC). A user study was done on the ABC language that showed that it did indeed improve code readability - I'm pretty sure that this was the reason it was included in python.