Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #109739 > unrolled thread

Re: for / while else doesn't make sense

Started byGrady Martin <sunnycemetery@gmail.com>
First post2016-06-09 08:50 -0400
Last post2016-06-09 08:50 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: for / while else doesn't make sense Grady Martin <sunnycemetery@gmail.com> - 2016-06-09 08:50 -0400

#109739 — Re: for / while else doesn't make sense

FromGrady Martin <sunnycemetery@gmail.com>
Date2016-06-09 08:50 -0400
SubjectRe: for / while else doesn't make sense
Message-ID<mailman.109.1465476802.2306.python-list@python.org>
On 2016年05月19日 11時02分, Ian Kelly wrote:
>"else" makes sense from a certain point of view, but I think that
>logic may not be communicated well. At the start of each loop
>iteration, the loop construct makes a test for whether the loop should
>continue or not. If that test ever fails (i.e. if the condition of the
>while loop is false), the else block is executed instead.

Thank you for the concise explanation.  (I enjoy new tools.)

As alluded to elsewhere, this distinction makes sense when loop breaking is involved.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web