Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Save yourself! Reboot in 5 seconds!


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

SubjectAuthor
o Re: Behavior of the for-else constructcomputermaster360

1
Re: Behavior of the for-else construct

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: computer...@gmail.com (computermaster360)
Newsgroups: comp.lang.python
Subject: Re: Behavior of the for-else construct
Date: Thu, 3 Mar 2022 20:38:33 +0100
Lines: 17
Message-ID: <mailman.133.1646336326.2329.python-list@python.org>
References: <CALq4Z0-fJk-HOu0ka2kPrOioPYAh3e3zbziwetUDmAAx1U1LMw@mail.gmail.com>
<BN8PR14MB285101A6BF0271714A46FAA2F5049@BN8PR14MB2851.namprd14.prod.outlook.com>
<CALq4Z0835VYuWyj67YK3T1JaJXcL9kZxg+N_QqcNa+ciD--X3g@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 ptgpEjrlE5DRIs3ffmMRnw3rujWnHAPEqeo2DMt3NKZQ==
Return-Path: <computermaster360@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=Z14+SWG8;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.006
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '2022': 0.05; 'joseph':
0.05; 'mar': 0.07; 'cc:addr:python-list': 0.09; 'somewhat': 0.16;
'subject:else': 0.16; '\xf0\x9f\x98\x8a': 0.16; 'wrote:': 0.16;
'thu,': 0.19; 'cc:addr:python.org': 0.20; 'cc:2**0': 0.25;
'request.': 0.28; 'think': 0.32; 'message-id:@mail.gmail.com':
0.32; 'but': 0.32; 'subject:for': 0.33; 'mean': 0.34; 'header:In-
Reply-To:1': 0.34; 'received:google.com': 0.34; 'item': 0.35;
'from:addr:gmail.com': 0.35; 'using': 0.37; 'received:209.85':
0.37; 'received:209': 0.39; 'items': 0.68
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
:cc:content-transfer-encoding;
bh=CTRJwOBk4LuMyUzh/EllHFIWeajBFPx+8Ev6EApIWa4=;
b=Z14+SWG8Ce1TMn2z2iRuG1brkBIBTXiPaZJsJyelJ+ZXK4BRVX1yijN3lO5vMKRd1C
QhaOneHMr2aqaF3wel9KeB75aPdDmJXsAxna0rphHcYy218fCwITRjVNjvYI8cjsLU5l
RfG4kGyLGizgvbXjGHoqL3Qvq7WM17WfDP2IhTxAIZs7veZcfc8Yn/2AAcZ5GCR2eOfW
RbbSWosfsYQ282jkv6UdueAZArTnZRb5F4bQajOXK4dLCK7fuANDZV/i/S6IKeE+S4B5
LKLBCLrlWvbKylvG+HM+8NvilSO6ZmuNdY3yviij5HYW2Sba+UiJvf7Ctz8hrTsjeDcQ
QnJQ==
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:cc:content-transfer-encoding;
bh=CTRJwOBk4LuMyUzh/EllHFIWeajBFPx+8Ev6EApIWa4=;
b=aPezJbgM9VOgamnMgWu0yFbt4JK3NqPgWW6KmNxLAtIRIsn9tAcu29ESSWFLGzR7d0
r5Z1n3zIQE6b+yBgrDLML5Db403CGj/ONsmF1odKsLuM6+MqgSBzySbwr6RJs5Fl7j43
WEVioN48H3+sep6mFKQoTGGV8OX0AjgxBHtCDzHs03IdTiBDequo+geI3StiT0YLeM+S
Otp4Q32lwowGHQR0yxYwgKdwt+rppfBC7NNZE4xltfsC5vLm0y7ssGNJJ4+iXjKTQk9I
UCFONq6Ik2MRQks+JbUbBvJLWK2vG7cUpUH4P6uxxdGyvFBz8JybS9yrPBRUiZlzjaci
ZrAg==
X-Gm-Message-State: AOAM5306E9rF24qpYndG3ADAEotAMdqUthipaDrYqTwLVRA821GSeISB
rys+5mk1v/ebiTYfPSQ6RmWHbOGa60AscXY6Ynw=
X-Google-Smtp-Source: ABdhPJyCNKeOo6F9CmC5NtnGZLzrmOsl6yh3psd+8WjPmr34ztE9KL9hQZTLCgJe8Cgl82v+hL2mMj0D6gphtSuKYbg=
X-Received: by 2002:a05:6808:188b:b0:2d4:f7bd:ef42 with SMTP id
bi11-20020a056808188b00b002d4f7bdef42mr5932090oib.179.1646336323801; Thu, 03
Mar 2022 11:38:43 -0800 (PST)
In-Reply-To: <BN8PR14MB285101A6BF0271714A46FAA2F5049@BN8PR14MB2851.namprd14.prod.outlook.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: <CALq4Z0835VYuWyj67YK3T1JaJXcL9kZxg+N_QqcNa+ciD--X3g@mail.gmail.com>
X-Mailman-Original-References: <CALq4Z0-fJk-HOu0ka2kPrOioPYAh3e3zbziwetUDmAAx1U1LMw@mail.gmail.com>
<BN8PR14MB285101A6BF0271714A46FAA2F5049@BN8PR14MB2851.namprd14.prod.outlook.com>
 by: computermaster360 - Thu, 3 Mar 2022 19:38 UTC

On Thu, 3 Mar 2022 at 18:25, Schachner, Joseph
<Joseph.Schachner@teledyne.com> wrote:
> I don't know what that would be. "finally" is available 😊 Write up a feature request.

Not sure if you mean `finally` seriously but I think that would about
as confusing as the current `else`, if not even more 😅

Meanwhile, I found another solution which is somewhat neater than
using a boolean flag:

item = sentinel = object()
for item in iterable:
do_stuff(item)

if item is sentinel:
print('No items in iterable!')

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor