for / while else doesn't make sense
random832 at fastmail.com
Wed Jun 15 13:41:01 EDT 2016
On Wed, Jun 15, 2016, at 13:18, Michael Selik wrote:
> On Wed, Jun 15, 2016, 10:28 AM Rustom Mody <rustompmody at gmail.com> wrote:
> > Where did the question of "break can be written as goto" come from?
> Stephen said the "else" in for-else was "unconditional". He argued that
> neither the presence nor absence of a break should be considered a
> condition, because we don't consider the occurrence or non-occurrence of
> exception (goto) as a condition of whether to run the else-clause.
Okay... so why don't we consider the else in *if*-else unconditional?
After all, the same logic applies: it only doesn't run if a statement
defined to jump past it (in one case, the true part of the if statement
- in the other case, a break) is run.
More information about the Python-list