Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Never make any mistaeks. -- Anonymous, in a mail discussion about to a kernel bug report


devel / comp.lang.python / Re: Friday Finking: Contorted loops

SubjectAuthor
o Re: Friday Finking: Contorted loopsMRAB

1
Re: Friday Finking: Contorted loops

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: pyt...@mrabarnett.plus.com (MRAB)
Newsgroups: comp.lang.python
Subject: Re: Friday Finking: Contorted loops
Date: Fri, 10 Sep 2021 16:36:39 +0100
Lines: 34
Message-ID: <mailman.685.1631288390.4164.python-list@python.org>
References: <097bf31d-44e8-da35-df41-3834524716c9@DancesWithMice.info>
<shfg3i$4e6$1@ciao.gmane.io>
<05c4abc0-70b6-b2ea-7cfa-1121d75d2126@mrabarnett.plus.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 6kBUTSxz39/Uq3EbPai8cw2q6IVVTeaC+odXpD8m6LOg==
Return-Path: <python@mrabarnett.plus.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=plus.com header.i=@plus.com header.b=nPy6BHg+;
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.012
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'fairly': 0.05; 'loop':
0.07; 'loops.': 0.07; 'constructs,': 0.09; 'from:addr:python':
0.09; 'received:192.168.1.64': 0.09; '[snip]': 0.16; 'break,':
0.16; 'cases,': 0.16; 'complete.': 0.16; 'effects.': 0.16;
'from:addr:mrabarnett.plus.com': 0.16; 'from:name:mrab': 0.16;
'gauld': 0.16; 'message-id:@mrabarnett.plus.com': 0.16;
'received:plus.net': 0.16; 'wrote:': 0.16; 'python': 0.16;
'to:addr:python-list': 0.23; 'else': 0.27; "didn't": 0.29; 'header
:User-Agent:1': 0.31; 'received:192.168.1': 0.31; 'there': 0.31;
'but': 0.31; 'exceptional': 0.32; 'nature': 0.32; 'python-list':
0.32; 'header:In-Reply-To:1': 0.33; 'same': 0.34;
'received:192.168': 0.37; "that's": 0.37; '(or': 0.37; "it's":
0.38; 'does': 0.38; 'skip:w 10': 0.61; 'body': 0.63; 'providing':
0.64; 'received:212': 0.68; 'further': 0.68; 'exactly': 0.69;
'quickly': 0.81; 'clause': 0.84; 'modest': 0.84; 'opposite': 0.91;
'operates': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019;
t=1631288201; bh=sSQjBe6md63l6m+03hAlEPY+tYdgNniXFJbduWst6g0=;
h=Subject:To:References:From:Date:In-Reply-To;
b=nPy6BHg+Bk8XSEnReTsy/xArOtH8VfLzcUFYgnPvE5ozT/oSsbs00uE6oOydlZ/CX
/5bZULTomgopXQjvA08F7Xlh1mgTxaNwqL5dg+6W152YuycUgvrKZeJq1pi/KAI8D1
ZwikZf3hmYUQhGFqmLfovP27U6RAKxL/zzTJ8Fm32WqKtdecl8eqIY3RY+sJtEo1JN
RQ1ahVNe8A5c27hzQb+M3EwytTBu/bs99HT9kuiB2phV0ANBtsguG1CFmqsdwL016y
t+mlwPkQuX0YfXqBVyWjL66hif5JdqZbs8CioDsqKms2Ka9iAykARMAaoJwZME0T8s
cimxyusqGm9+A==
X-Clacks-Overhead: "GNU Terry Pratchett"
X-CM-Score: 0.00
X-CNFS-Analysis: v=2.3 cv=FKGAO9gs c=1 sm=1 tr=0
a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17
a=IkcTkHD0fZMA:10 a=VOCBt9Ev4PTI0DHTpwwA:9 a=QEXdDO2ut3YA:10
X-AUTH: mrabarnett@:2500
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
In-Reply-To: <shfg3i$4e6$1@ciao.gmane.io>
Content-Language: en-GB
X-CMAE-Envelope: MS4wfD4pi0hQlbBuwVErV3UFUvI8x1FrzOtPodREsaC7y94RuU3LK9c/dP3nMzIQUjTaYwGtdISeWddW0Pcsyo7A+OkvXu9b4nUPtMl4pdThKJz0pqr7aQd9
FP2cEoIU+jmNdQjGG+P7h2Ux0TtbyqpPrWTm+BaC//Nnh0CqgTq2oaLGx8wBmgkdDQ7ZcMQtB2iTSw==
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
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: <05c4abc0-70b6-b2ea-7cfa-1121d75d2126@mrabarnett.plus.com>
X-Mailman-Original-References: <097bf31d-44e8-da35-df41-3834524716c9@DancesWithMice.info>
<shfg3i$4e6$1@ciao.gmane.io>
 by: MRAB - Fri, 10 Sep 2021 15:36 UTC

On 2021-09-10 12:38, Alan Gauld via Python-list wrote:
> On 09/09/2021 22:36, dn via Python-list wrote:
>
>> Even in fairly modest Python constructs, we quickly repeal the one-in,
>> one-out philosophy because try...except operates by providing another
>> exit-path.
>
> Exceptions are exceptional by their nature (or should be!) As such
> they can arguably be excused from the SP strictures.
>
> But python complicates this tenet still further by adding an else
> clause to its loops. And complicating this still more is that these
> else clauses have almost exactly opposite effects.
>
> while...else...
>
> executes the else if the body of the loop does NOT get executed.
>
> for...else...
>
> executes the else iff ALL iterations of the for loop DO complete.
>
[snip]

In both cases, it executes the 'else' part if it didn't break out of the
loop. That's it.

If all of the iterations completed, then there was no break, so the
'else' part is executed.

If there were no iterations, then there was no break, so the 'else' part
is executed.

It's the same for both of them.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor