Nick Coghlan wrote:

> I don't think that's a good idea. What would the following monstrosity
> mean?:
> 
>    if 0:
>        print "Ran the if"
>    else for item in (1, 2, 3):
>        print item
>    else try:
>        print "No exception here!"
>    except:
>        pass
>    else:
>        print "Who's else is this, anyway?"

It is unambiguous. But:

> The use-case of 'elif' or 'else if' to avoid nested if statements is
> strong, but the use cases for the ability to mix compound statements
> together is significantly weaker.

This is not even about use cases anymore, it's about usability.
Indentation (by indicating nesting) serves well to recognize at first
sight what belongs together, and what doesn't. Mixing compound statements
breaks this, as it requires the reader to think about it twice, if that's
even enough.

-- 
Thomas


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to