Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

* dpkg ponders: 'C++' should have been called 'D' -- #Debian


devel / comp.lang.python / Re: Behavior of the for-else construct

SubjectAuthor
* Re: Behavior of the for-else constructRob Cliffe
+* Re: Behavior of the for-else constructJach Feng
|`- Re: Behavior of the for-else constructAvi Gross
+- Re: Behavior of the for-else constructChris Angelico
`- Re: Behavior of the for-else constructMichael F. Stemper

1
Re: Behavior of the for-else construct

<mailman.147.1646358970.2329.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17325&group=comp.lang.python#17325

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: rob.cli...@btinternet.com (Rob Cliffe)
Newsgroups: comp.lang.python
Subject: Re: Behavior of the for-else construct
Date: Fri, 4 Mar 2022 01:54:03 +0000
Lines: 16
Message-ID: <mailman.147.1646358970.2329.python-list@python.org>
References: <CALq4Z0-fJk-HOu0ka2kPrOioPYAh3e3zbziwetUDmAAx1U1LMw@mail.gmail.com>
<YiFCPlGC+2aRIR0K@shallowsky.com>
<21739669.459456.1646348879560@mail.yahoo.com>
<CAPTjJmoXyHF_N1E2KFZ+YZmZ8+zm4E_Pra_hbXLHWuNs1XtiBQ@mail.gmail.com>
<46ef1b7f-5689-0cd5-ce89-be4c453d262f@btinternet.com>
<fc4d9ade-9ee6-589f-def5-a9279c399c21@stoneleaf.us>
<08edeac4-1d59-ce5c-663b-42d75e6d8da4@btinternet.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 8KVOFO6jR9kWv8CtywW0RgBfj0x8r01RvaES9ipoQ1HA==
Return-Path: <rob.cliffe@btinternet.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=btinternet.com header.i=@btinternet.com header.b=cKzJ+1C5;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.037
X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; '5:32': 0.09;
'received:192.168.1.64': 0.09; 'problem.': 0.15; 'ethan': 0.16;
'subject:else': 0.16; '~ethan~': 0.16; 'wrote:': 0.16; 'pm,':
0.19; 'to:addr:python-list': 0.20; 'header:User-Agent:1': 0.30;
'python-list': 0.32; 'received:192.168.1': 0.32; 'subject:for':
0.33; 'there': 0.33; 'header:In-Reply-To:1': 0.34; 'count': 0.36;
'those': 0.36; 'received:192.168': 0.37; 'received:213': 0.40;
'10,': 0.61; 'types': 0.67; 'rob': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=btinternet.com;
s=btmx201904; t=1646358847;
bh=xOKv4sVE2NVjM5Sxi/iWasvmB9XLx451wmEWCtVAboY=;
h=Message-ID:Date:MIME-Version:Subject:To:References:From:In-Reply-To;
b=cKzJ+1C5KhexebOwkXoPu7pQvpUGpXd2LEE4oUrGTJezmevDg71brYbctusJT03uyOz47zpSCvnLHH3dLLbiOM8VuxR8AGSnvZvbsAtugd6r8QrUHqVkRG9+zRzTA8GmMHPoIFm4CVAH9TdtzYSau7VYGzPpsMSK+Zntf8TkRsPA4h1MumvQM9SdmnV+muQS+ZUJsUBj6uAWHpuBlu1jQTIEcJwQMM8DMiFKVSGIsZSFfwC5f6dTb+9NFxCt4ORcJzQIsGoLD2pUXZDUt9y0qpqzi+U8TtJlqiXL7dyjTP8BEZc3r3vIRgZrERhmocWQ8dGCAViSvu/+Oq9/Ib+Iyw==
Authentication-Results: btinternet.com;
auth=pass (PLAIN) smtp.auth=rob.cliffe@btinternet.com;
bimi=skipped
X-SNCR-Rigid: 613A9124172CCC4C
X-Originating-IP: [86.173.124.29]
X-OWM-Source-IP: 86.173.124.29 (GB)
X-OWM-Env-Sender: rob.cliffe@btinternet.com
X-VadeSecure-score: verdict=clean score=0/300, class=clean
X-RazorGate-Vade: gggruggvucftvghtrhhoucdtuddrgedvvddruddtjedggedtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuueftkffvkffujffvgffngfevqffopdfqfgfvnecuuegrihhlohhuthemuceftddunecunecujfgurhepkfffgggfuffvfhfhjggtgfesthekredttdefjeenucfhrhhomheptfhosgcuvehlihhffhgvuceorhhosgdrtghlihhffhgvsegsthhinhhtvghrnhgvthdrtghomheqnecuggftrfgrthhtvghrnhepvdetudfhtefgveegieffleelvdeugfeikeevveehudetgfevieejfedtteevtdegnecukfhppeekiedrudejfedruddvgedrvdelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehhvghloheplgduledvrdduieekrddurdeigegnpdhinhgvthepkeeirddujeefrdduvdegrddvledpmhgrihhlfhhrohhmpehrohgsrdgtlhhifhhfvgessghtihhnthgvrhhnvghtrdgtohhmpdhnsggprhgtphhtthhopedupdhrtghpthhtohepphihthhhohhnqdhlihhsthesphihthhhohhnrdhorhhg
X-RazorGate-Vade-Verdict: clean 0
X-RazorGate-Vade-Classification: clean
X-SNCR-hdrdom: btinternet.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Thunderbird/91.6.1
Content-Language: en-GB
In-Reply-To: <fc4d9ade-9ee6-589f-def5-a9279c399c21@stoneleaf.us>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <08edeac4-1d59-ce5c-663b-42d75e6d8da4@btinternet.com>
X-Mailman-Original-References: <CALq4Z0-fJk-HOu0ka2kPrOioPYAh3e3zbziwetUDmAAx1U1LMw@mail.gmail.com>
<YiFCPlGC+2aRIR0K@shallowsky.com>
<21739669.459456.1646348879560@mail.yahoo.com>
<CAPTjJmoXyHF_N1E2KFZ+YZmZ8+zm4E_Pra_hbXLHWuNs1XtiBQ@mail.gmail.com>
<46ef1b7f-5689-0cd5-ce89-be4c453d262f@btinternet.com>
<fc4d9ade-9ee6-589f-def5-a9279c399c21@stoneleaf.us>
 by: Rob Cliffe - Fri, 4 Mar 2022 01:54 UTC

On 04/03/2022 01:44, Ethan Furman wrote:
> On 3/3/22 5:32 PM, Rob Cliffe via Python-list wrote:
>
> > There are three types of programmer: those that can count, and those
> that can't.
>
> Actually, there are 10 types of programmer:  those that can count in
> binary, and those that can't.
1, 10, many.
No problem.
>
> --
> ~Ethan~

Re: Behavior of the for-else construct

<57410dc1-a2cd-45c5-8212-0df598b1f1bbn@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17326&group=comp.lang.python#17326

  copy link   Newsgroups: comp.lang.python
X-Received: by 2002:ac8:5883:0:b0:2dd:1a8:4171 with SMTP id t3-20020ac85883000000b002dd01a84171mr29707292qta.171.1646360521647;
Thu, 03 Mar 2022 18:22:01 -0800 (PST)
X-Received: by 2002:ac8:57c9:0:b0:2d7:f146:159b with SMTP id
w9-20020ac857c9000000b002d7f146159bmr30407646qta.257.1646360521490; Thu, 03
Mar 2022 18:22:01 -0800 (PST)
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.python
Date: Thu, 3 Mar 2022 18:22:01 -0800 (PST)
In-Reply-To: <mailman.147.1646358970.2329.python-list@python.org>
Injection-Info: google-groups.googlegroups.com; posting-host=220.142.173.180; posting-account=G2sM6AoAAADOlDdo9rWD6sFkj3T5ULsz
NNTP-Posting-Host: 220.142.173.180
References: <CALq4Z0-fJk-HOu0ka2kPrOioPYAh3e3zbziwetUDmAAx1U1LMw@mail.gmail.com>
<YiFCPlGC+2aRIR0K@shallowsky.com> <21739669.459456.1646348879560@mail.yahoo.com>
<CAPTjJmoXyHF_N1E2KFZ+YZmZ8+zm4E_Pra_hbXLHWuNs1XtiBQ@mail.gmail.com>
<46ef1b7f-5689-0cd5-ce89-be4c453d262f@btinternet.com> <08edeac4-1d59-ce5c-663b-42d75e6d8da4@btinternet.com>
<fc4d9ade-9ee6-589f-def5-a9279c399c21@stoneleaf.us> <mailman.147.1646358970.2329.python-list@python.org>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <57410dc1-a2cd-45c5-8212-0df598b1f1bbn@googlegroups.com>
Subject: Re: Behavior of the for-else construct
From: jfo...@ms4.hinet.net (Jach Feng)
Injection-Date: Fri, 04 Mar 2022 02:22:01 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Lines: 6
 by: Jach Feng - Fri, 4 Mar 2022 02:22 UTC

I never feel confused by "else" because I always think it in "break...else", not "for...else". For those who always think in "for...else" deserves this confusion and it can't be just escaped by replacing with another magic word such as "then" or "finally" etc:-)

--Jach

Re: Behavior of the for-else construct

<mailman.151.1646364943.2329.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17330&group=comp.lang.python#17330

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: avigr...@verizon.net (Avi Gross)
Newsgroups: comp.lang.python
Subject: Re: Behavior of the for-else construct
Date: Fri, 4 Mar 2022 03:35:38 +0000 (UTC)
Lines: 24
Message-ID: <mailman.151.1646364943.2329.python-list@python.org>
References: <CALq4Z0-fJk-HOu0ka2kPrOioPYAh3e3zbziwetUDmAAx1U1LMw@mail.gmail.com>
<YiFCPlGC+2aRIR0K@shallowsky.com>
<21739669.459456.1646348879560@mail.yahoo.com>
<CAPTjJmoXyHF_N1E2KFZ+YZmZ8+zm4E_Pra_hbXLHWuNs1XtiBQ@mail.gmail.com>
<46ef1b7f-5689-0cd5-ce89-be4c453d262f@btinternet.com>
<08edeac4-1d59-ce5c-663b-42d75e6d8da4@btinternet.com>
<fc4d9ade-9ee6-589f-def5-a9279c399c21@stoneleaf.us>
<mailman.147.1646358970.2329.python-list@python.org>
<57410dc1-a2cd-45c5-8212-0df598b1f1bbn@googlegroups.com>
<855798084.499768.1646364938449@mail.yahoo.com>
Reply-To: Avi Gross <avigross@verizon.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de VV9t8Zn4SHs3GUpY5M/1oQ25MzRH0Pt2WpLNpHN5TGRw==
Return-Path: <avigross@verizon.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=verizon.net header.i=@verizon.net header.b=B7jfgWkQ;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.017
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '2022': 0.05; 'else.':
0.07; 'loop': 0.07; 'mar': 0.07; 'construct': 0.09; 'url:mailman':
0.15; 'anyway.': 0.16; 'confused': 0.16; 'confusion': 0.16;
'levels,': 0.16; 'loops': 0.16; 'nested': 0.16; 'subject:else':
0.16; "can't": 0.17; 'thu,': 0.19; 'to:addr:python-list': 0.20;
'languages': 0.22; 'to:name:python-list@python.org': 0.24; 'skip:-
10': 0.25; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'url:listinfo': 0.25; 'url-
ip:188.166/16': 0.25; 'seems': 0.26; 'behavior': 0.26; 'else':
0.27; 'it,': 0.29; 'url-ip:188/8': 0.31; 'think': 0.32;
'subject:for': 0.33; 'particular': 0.33; 'same': 0.34; 'header:In-
Reply-To:1': 0.34; 'meaning': 0.35; 'those': 0.36; 'way': 0.38;
'two': 0.39; 'break': 0.39; 'something': 0.40; 'from:': 0.62;
'to:': 0.62; 'feel': 0.63; 're:': 0.64; 'look': 0.65; 'deeply':
0.69; 'sent:': 0.78; 'header:Reply-To:1': 0.79; 'whole.': 0.84;
'received:74.6.132': 0.91; 'replacing': 0.91; 'magic': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.net; s=a2048;
t=1646364940; bh=Po16u4SyZ4Xw4g1YX3wGgNs4+2sMAe2Rpr7ckhNUn1E=;
h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject:Reply-To;
b=B7jfgWkQf5TIXb8C1iBsv1mB4lYf5ysTGSaYylHBUN8hPxV877Ov7KY+tj3WftPXrKNcYbgnDg3Au6T3o1ktppEZdbtm93bfPmiAN6vErNEdonuE+LO90nACHUx8lRV8Qm93G2sVcYraZQeZWeVsgCZdmdXJcthVJK/4vXBZSwRqB/HCWMpM8KtbSbBCQABQ0rcgtFhhY4acBWh91e/PSIe0yiehH6UEfSwPhrgWM+pWIDShsUIwTGIUbBRDtQ+9ExzPJalkcnWPJVWtncbT6kYzCgDYfna1tl2kLsHbFYFJmJK6faY+Ll0nnv23BXydQS9O4GFmDb5qckDYH5/Wyg==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1646364940; bh=0Q7mHbY3Je+90di0RPkm7NRJEK9572QfE3jRmQ24YHy=;
h=X-Sonic-MF:Date:From:To:Subject:From:Subject;
b=JeNvarLFo6Z5Ohu4ekj/MENAfuZTyGrrjHEtIXVErYFBa+oE+Y1/WwqoznHf94aOGvWWW5UMKWCT5YlD4VC7jRp+xwwx6Lwlb1hot7JzuwQAvG+9XijjzlhP58csme3hcG6tiFWAMeC60xQz2QLkyLNBlXKz7mZGf1mDtwykqQbCglVql8b8PSa+LGhX0WsMCKXQx4WTR3h48+fuw5bA8PyC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qdMw61FU_ETHFFxrk614xuUtGjkraSjgRJyzf8vmoiTbO711J9vL62Vej3
Ve58PKyUOcQxJ4rB4NMsm8Vsp8_uSnyGtyJnkNRNpVLUJER1oIphbY1XL1IbGjvAZK9uYbskovcr
1_FXfqNOik1deZLkhjMIgfevKX9DoUzo_SZ9OKV.9OZ6OkTIuO52mXZhUPUKIAbIsw6b88FnsvBs
AGtJC1ledZr9N6aaU7kq_WEZepieTpDoa9f0ynegjKk620qIaaIqlLuj.aXlYhSDaL__udUoRSmR
OhebbB7jGVA--
X-Sonic-MF: <avigross@verizon.net>
In-Reply-To: <57410dc1-a2cd-45c5-8212-0df598b1f1bbn@googlegroups.com>
X-Mailer: WebService/1.1.19724 aolwebmail
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <855798084.499768.1646364938449@mail.yahoo.com>
X-Mailman-Original-References: <CALq4Z0-fJk-HOu0ka2kPrOioPYAh3e3zbziwetUDmAAx1U1LMw@mail.gmail.com>
<YiFCPlGC+2aRIR0K@shallowsky.com>
<21739669.459456.1646348879560@mail.yahoo.com>
<CAPTjJmoXyHF_N1E2KFZ+YZmZ8+zm4E_Pra_hbXLHWuNs1XtiBQ@mail.gmail.com>
<46ef1b7f-5689-0cd5-ce89-be4c453d262f@btinternet.com>
<08edeac4-1d59-ce5c-663b-42d75e6d8da4@btinternet.com>
<fc4d9ade-9ee6-589f-def5-a9279c399c21@stoneleaf.us>
<mailman.147.1646358970.2329.python-list@python.org>
<57410dc1-a2cd-45c5-8212-0df598b1f1bbn@googlegroups.com>
 by: Avi Gross - Fri, 4 Mar 2022 03:35 UTC

That is one way to look at it, Jach. Of course, a particular loop may have multiple break statements each meaning something else. The current implementation makes all of them jump to the same ELSE statement so in one sense, I consider the ELSE to be associated with the loop as a whole. Sometimes the loop may not even have a break statement and yet the dangling ELSE seems to be accepted anyway.

Some languages allow you to break out of deeply nested loops by jumping up two or more levels, perhaps to a label and are more of a goto. I shudder to think how that would work if each loop had an ELSE dangling.

-----Original Message-----
From: Jach Feng <jfong@ms4.hinet.net>
To: python-list@python.org
Sent: Thu, Mar 3, 2022 9:22 pm
Subject: Re: Behavior of the for-else construct

I never feel confused by "else" because I always think it in "break...else", not "for...else". For those who always think in "for...else" deserves this confusion and it can't be just escaped by replacing with another magic word such as "then" or "finally" etc:-)

--Jach

--

https://mail.python.org/mailman/listinfo/python-list

Re: Behavior of the for-else construct

<mailman.152.1646365304.2329.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17331&group=comp.lang.python#17331

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: Behavior of the for-else construct
Date: Fri, 4 Mar 2022 14:41:32 +1100
Lines: 26
Message-ID: <mailman.152.1646365304.2329.python-list@python.org>
References: <CALq4Z0-fJk-HOu0ka2kPrOioPYAh3e3zbziwetUDmAAx1U1LMw@mail.gmail.com>
<YiFCPlGC+2aRIR0K@shallowsky.com>
<21739669.459456.1646348879560@mail.yahoo.com>
<CAPTjJmoXyHF_N1E2KFZ+YZmZ8+zm4E_Pra_hbXLHWuNs1XtiBQ@mail.gmail.com>
<46ef1b7f-5689-0cd5-ce89-be4c453d262f@btinternet.com>
<08edeac4-1d59-ce5c-663b-42d75e6d8da4@btinternet.com>
<fc4d9ade-9ee6-589f-def5-a9279c399c21@stoneleaf.us>
<mailman.147.1646358970.2329.python-list@python.org>
<57410dc1-a2cd-45c5-8212-0df598b1f1bbn@googlegroups.com>
<855798084.499768.1646364938449@mail.yahoo.com>
<CAPTjJmp7EqnL4LHx1VoFKqTQpkgcYL9=3cXa2r8dss38C3808Q@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de T3A4NHqvq9LV9XBfbRgFMAScVgaIqq+cFxbhOmQyuKrg==
Return-Path: <rosuav@gmail.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=gmail.com header.i=@gmail.com header.b=KcQ7efmx;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.021
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; '2022': 0.05; 'else.':
0.07; 'loop': 0.07; 'mar': 0.07; 'anyway.': 0.16; 'avi': 0.16;
'chrisa': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris
angelico': 0.16; 'gross': 0.16; 'levels,': 0.16; 'loops': 0.16;
'nested': 0.16; 'subject:else': 0.16; 'wrote:': 0.16; 'python':
0.16; 'to:addr:python-list': 0.20; 'languages': 0.22; 'fri,':
0.22; 'way.': 0.22; 'to:name:python-list@python.org': 0.24;
'seems': 0.26; 'else': 0.27; 'it,': 0.29; 'think': 0.32; 'python-
list': 0.32; 'message-id:@mail.gmail.com': 0.32; 'but': 0.32;
"i'm": 0.33; 'subject:for': 0.33; 'particular': 0.33; 'same':
0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'meaning': 0.35; 'one.': 0.35; 'from:addr:gmail.com': 0.35;
"it's": 0.37; 'received:209.85': 0.37; 'way': 0.38; 'could': 0.38;
'received:209': 0.39; 'two': 0.39; 'break': 0.39; 'happen': 0.40;
'something': 0.40; 'simply': 0.63; 'look': 0.65; 'named': 0.65;
'exactly': 0.68; 'deeply': 0.69; 'concept,': 0.84; 'heart,': 0.84;
'honestly,': 0.84; 'whole.': 0.84; 'body,': 0.91; 'fan': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
:content-transfer-encoding;
bh=mFzr2tKJa3S9qq/cwsKYVDUPZmF1KJjS8ocFpz0nzYw=;
b=KcQ7efmxkj2Kjqx9Q1lKYTLyLd6NZWIG+L0HS1mfZ0MYBKrbCH8/nHNzIavTODpo/W
h6VcWoS4PwNoVc8n0GHL0xEMkm4sTk4BWrsc4PsNOwtencDbaGCgIpO7/cb5rcA5IPr2
gk0QTJ3uYsHQqHVCygPAbMDHqDnVfroTU1szajyiO/eo1654g8Ob3zvrhrNfrh52syIQ
8aDANGH2z/4h4iBnXBtYw6o2ZwFgmpKocTxF8SarA4bYijVL+A1gQg8R4vQC+IACvxTw
HE5arS7sMUOTMUEJqaiUmDqfZ8hg+Aa5jez/FJ6Y/rW68HNAXYbloEQnOwkwElGOdYM9
YX9Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to:content-transfer-encoding;
bh=mFzr2tKJa3S9qq/cwsKYVDUPZmF1KJjS8ocFpz0nzYw=;
b=Z8xA5aGZjBjlB7UfdAtg37bUk92Pncusskptxak5alDbDAMy3k9Vstg7KFDW6Gd9pl
Ris2BaFqwzlYhLRduj7E8C1zbn1LlUgYu31iX61lq0ttDVuV/gaRlW81nmKJXffbiQ1x
Onx2qyGnKn0EuVoQB/8+Agau8+JL+9rDvRkXoryG+EGxBcgq5fRnOZi505Fik2qq3I2d
0K2PeDq7bHp7RMTGvpL6HZZCiOyUDuqPkg37oTLIpGV1Vb5TQpP5z4BCub4duUuydcLZ
bgTkqB4/86M1hKyioUuM4cq41DsHN/YCncjy2HmjgYylhpuG7ZCKJwG+I6gqNJQfS25S
jUVA==
X-Gm-Message-State: AOAM530lYByQODQBqIzRxzF5r35gw3IkErpC1Dp4njPS9iUvLGEGs4W0
F160cLKAronLf+X2JRzKPFymouK9DsM1oXWzbdTvqpvv
X-Google-Smtp-Source: ABdhPJyQImAmC0IhJpcOMkt1nt3VSBU7UU6JywK/d9B8rb6q22sV6vSGoI/vZVjdOmyyGt6L1YbppFAc5cmyCN3rD4Q=
X-Received: by 2002:adf:f801:0:b0:1f0:7675:f5e6 with SMTP id
s1-20020adff801000000b001f07675f5e6mr769543wrp.564.1646365303040; Thu, 03 Mar
2022 19:41:43 -0800 (PST)
In-Reply-To: <855798084.499768.1646364938449@mail.yahoo.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <CAPTjJmp7EqnL4LHx1VoFKqTQpkgcYL9=3cXa2r8dss38C3808Q@mail.gmail.com>
X-Mailman-Original-References: <CALq4Z0-fJk-HOu0ka2kPrOioPYAh3e3zbziwetUDmAAx1U1LMw@mail.gmail.com>
<YiFCPlGC+2aRIR0K@shallowsky.com>
<21739669.459456.1646348879560@mail.yahoo.com>
<CAPTjJmoXyHF_N1E2KFZ+YZmZ8+zm4E_Pra_hbXLHWuNs1XtiBQ@mail.gmail.com>
<46ef1b7f-5689-0cd5-ce89-be4c453d262f@btinternet.com>
<08edeac4-1d59-ce5c-663b-42d75e6d8da4@btinternet.com>
<fc4d9ade-9ee6-589f-def5-a9279c399c21@stoneleaf.us>
<mailman.147.1646358970.2329.python-list@python.org>
<57410dc1-a2cd-45c5-8212-0df598b1f1bbn@googlegroups.com>
<855798084.499768.1646364938449@mail.yahoo.com>
 by: Chris Angelico - Fri, 4 Mar 2022 03:41 UTC

On Fri, 4 Mar 2022 at 14:37, Avi Gross via Python-list
<python-list@python.org> wrote:
>
> That is one way to look at it, Jach. Of course, a particular loop may have multiple break statements each meaning something else. The current implementation makes all of them jump to the same ELSE statement so in one sense, I consider the ELSE to be associated with the loop as a whole. Sometimes the loop may not even have a break statement and yet the dangling ELSE seems to be accepted anyway.
>
> Some languages allow you to break out of deeply nested loops by jumping up two or more levels, perhaps to a label and are more of a goto. I shudder to think how that would work if each loop had an ELSE dangling.
>

It would happen exactly the same way. I don't know why you're so
afraid of the else clause. It's simply part of the loop body, and if
you break out of the loop body, you skip it. If Python had a way to
break out of multiple loop bodies at once, it would skip the else
clauses of any that you break out of.

This is not complicated. You can argue that it could be better named
(but honestly, I'm not a fan of any of the other proposed names
either), but the concept, at its heart, is a simple one.

ChrisA

Re: Behavior of the for-else construct

<svtu9k$88t$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17357&group=comp.lang.python#17357

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: michael....@gmail.com (Michael F. Stemper)
Newsgroups: comp.lang.python
Subject: Re: Behavior of the for-else construct
Date: Fri, 4 Mar 2022 14:54:12 -0600
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <svtu9k$88t$1@dont-email.me>
References: <CALq4Z0-fJk-HOu0ka2kPrOioPYAh3e3zbziwetUDmAAx1U1LMw@mail.gmail.com>
<YiFCPlGC+2aRIR0K@shallowsky.com>
<21739669.459456.1646348879560@mail.yahoo.com>
<CAPTjJmoXyHF_N1E2KFZ+YZmZ8+zm4E_Pra_hbXLHWuNs1XtiBQ@mail.gmail.com>
<46ef1b7f-5689-0cd5-ce89-be4c453d262f@btinternet.com>
<fc4d9ade-9ee6-589f-def5-a9279c399c21@stoneleaf.us>
<08edeac4-1d59-ce5c-663b-42d75e6d8da4@btinternet.com>
<mailman.147.1646358970.2329.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 4 Mar 2022 20:54:13 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="fb93ad6f45fa17b3e5043b0377936e79";
logging-data="8477"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19EmxFFzvsXOMPa0mbwVS0AZZglUmV47wA="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.10.0
Cancel-Lock: sha1:jSLHM4MRMAkG8gGxOcY1Jfl4ADE=
In-Reply-To: <mailman.147.1646358970.2329.python-list@python.org>
Content-Language: en-US
 by: Michael F. Stemper - Fri, 4 Mar 2022 20:54 UTC

On 03/03/2022 19.54, Rob Cliffe wrote:
> On 04/03/2022 01:44, Ethan Furman wrote:
>> On 3/3/22 5:32 PM, Rob Cliffe via Python-list wrote:
>>
>> > There are three types of programmer: those that can count, and those that can't.
>>
>> Actually, there are 10 types of programmer:  those that can count in binary, and those that can't.
> 1, 10, many.
> No problem.

Ah, a George Gamow fan.

--
Michael F. Stemper
Psalm 82:3-4

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor