[Python-ideas] "else if" as equivalent for "elif"

Random832 random832 at fastmail.com
Wed Oct 21 21:21:18 CEST 2015


Andrew Barnert via Python-ideas
<python-ideas at python.org> writes:

> Also, the number of people coming to Python from C and its descendants
> (especially Java and JavaScript) is high enough that the false
> impression given by "else if" (that it's just an if statement
> controlled by an else clause) could be harmful. Yes, once you think
> about it, the fact that there's no colon after the "else" and only one
> level of indentation instead of two makes sense, but you shouldn't
> have to think about it.

Could go all the way and actually allow "else: if ...:" or any other
combination such as "for ...: if...:" with a single level of
indentation.

I bet that's been proposed and rejected before.



More information about the Python-ideas mailing list