This is very true. The pre-condition is different among all 3 cases.
However, there is more similarity to them than is currently presented. I.e.:
All of them are executed if some condition is NOT satisfied.
So one POV how I see this proposal is the attempt to put these under the same umbrella as appropriate by making clauses that are entered when some condition is NOT satisfied consistent.
Currently it is emphasised that these are completely different cases with individual syntaxes, thus difficulties in learning them.
Addition of elif
could shift this POV by revealing their similarity. E.g. It could be taught as:
elif-else
clause combination is entered when a certain condition in the initial statement-clause construct is NOT satisfied. These conditions are different for different cases: if
, while & for
and try-except
.
So the syntax is the same, functionality is the same - there is a pattern that supports learning more functionality with less concepts to digest.
So far what I have observed is that there is a major difficulty in presenting this proposal because people are not comfortable with existing else
in for
and while
statements.
I think elif
addition together with a slight change of the way to think about it could address this issue.