Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

"Go to Heaven for the climate, Hell for the company." -- Mark Twain


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

SubjectAuthor
o Re: Behavior of the for-else constructAvi Gross

1
Re: Behavior of the for-else construct

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!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: Thu, 3 Mar 2022 23:07:59 +0000 (UTC)
Lines: 85
Message-ID: <mailman.136.1646348884.2329.python-list@python.org>
References: <CALq4Z0-fJk-HOu0ka2kPrOioPYAh3e3zbziwetUDmAAx1U1LMw@mail.gmail.com>
<YiFCPlGC+2aRIR0K@shallowsky.com>
<21739669.459456.1646348879560@mail.yahoo.com>
Reply-To: Avi Gross <avigross@verizon.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de NGSifBdmYBGplC0yjiZ/lwpQV4uQ2v6Y9i4y3uWRMhrQ==
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=Q1N+hSeQ;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.018
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'python?': 0.03; '2022':
0.05; 'fairly': 0.05; 'else.': 0.07; 'exit': 0.07; 'loop': 0.07;
'mar': 0.07; 'used.': 0.07; 'construct': 0.09; 'else:': 0.09;
'emacs': 0.09; 'ended': 0.09; 'it)': 0.09; 'operators': 0.09;
'readable': 0.09; 'writes:': 0.09; 'url:mailman': 0.15; 'does,':
0.16; 'flow.': 0.16; 'instead.': 0.16; 'order?': 0.16; 'recall':
0.16; 'reminds': 0.16; 'sentences,': 0.16; 'subject:else': 0.16;
'triggered': 0.16; 'typing': 0.16; 'wrapper': 0.16; 'instead':
0.17; 'implement': 0.19; 'thu,': 0.19; 'to:addr:python-list':
0.20; 'language': 0.21; 'languages': 0.22; 'version': 0.23;
'code': 0.23; '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; 'anyone':
0.25; 'seems': 0.26; 'behavior': 0.26; 'leave': 0.27; 'else':
0.27; 'bit': 0.27; 'function': 0.27; 'sense': 0.28; 'it,': 0.29;
'code,': 0.31; 'url-ip:188/8': 0.31; 'wondering': 0.31; "doesn't":
0.32; 'context': 0.32; 'language.': 0.32; 'requests,': 0.32;
'signal': 0.32; 'specified': 0.32; 'words,': 0.32; "wouldn't":
0.32; 'but': 0.32; 'subject:for': 0.33; 'there': 0.33;
'particular': 0.33; 'someone': 0.34; 'same': 0.34; "didn't": 0.34;
'header:In-Reply-To:1': 0.34; 'running': 0.34; 'people': 0.36;
'really': 0.37; 'hard': 0.37; 'could': 0.38; 'means': 0.38;
'read': 0.38; 'changes': 0.39; 'quite': 0.39; 'added': 0.39;
'adding': 0.39; 'use': 0.39; 'break': 0.39; 'still': 0.40;
'difficult': 0.40; 'wants': 0.40; 'both': 0.40; 'something': 0.40;
'want': 0.40; 'should': 0.40; 'remember': 0.61; 'here.': 0.61;
'above': 0.62; 'from:': 0.62; 'to:': 0.62; 'forward': 0.62;
'ever': 0.63; 'simply': 0.63; 'once': 0.63; 'imagine': 0.64;
're:': 0.64; 'your': 0.64; 'look': 0.65; 'worked': 0.67; 'back':
0.67; 'caught': 0.67; 'items': 0.68; 'conditions': 0.70; 'survey':
0.71; 'little': 0.73; 'easy': 0.74; 'non': 0.75; 'hearing': 0.75;
'....': 0.76; 'sponsored': 0.76; 'sent:': 0.78; 'header:Reply-
To:1': 0.79; 'up,': 0.84; 'bind': 0.84; 'desperately': 0.84;
'entered': 0.84; 'implies': 0.84; 'macro': 0.84; 'signals': 0.84;
'signs': 0.84; 'was.': 0.84; 'expensive': 0.91; 'mind,': 0.93;
'cut': 0.95
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.net; s=a2048;
t=1646348881; bh=0cnEU3irtIGmU1CQAfVaei4dkEf0OLCUPrlNL90Mr/0=;
h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject:Reply-To;
b=Q1N+hSeQSjFHrbPe75+pA14oRdFDi4ZPf6+yqNcQDn+ZgEcmPjqnTjbFOR5fLqUHIkGdLpasXeX9HgJ5R4zE1mksInl9FMZuv0SYtl4jkiB5LUjPcK56ED6YaQXwuyByRdri++67I+sv5V7y+w/uZONJcyqUMj8+Bf0tBcteXMw9dLd3QazzAhcFQuhLxJPOjFgPeHMhwcU+Ka4Gfuf2IzG46ZaEBbGdgWRPbC87XzY21C4PY0Mm10pKeep5DWR9tEtrf5YV7JPlTD1+TX4W3n6W/7pFW/8XidNqtbYHmPx38nkQXaNaKT9+2T/xeamKwhNnTuh3RyndbMV77SXjfQ==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1646348881; bh=KOfdsrG9uuEsuEsxz686M0pTpJckuZMth1HMMpNyfmo=;
h=X-Sonic-MF:Date:From:To:Subject:From:Subject;
b=pjsb3H//d3cxmfFiiDe9/636vTokiA3h6OIxAUyFxoeOO2Cx8Atu0hHJmUEbMGIFNSk28xq3a1D2P8ifaUQyIzIjNpGPQhar1+iHDS0UmsSeBq5n8KXXsQtmw87pWGa8rUCfwgMPLsumCB8NoaHVhGZ2rbwNI2hBdY7Vwa7KzWMPREQaIQnn4eGLossok6bKZycocNKTvRhYWU3UKBKOiL1L1NhEgMUZulA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2BevpXrxzkJJtupUM1jSa94ViGuZYXCvUHiIBq6xcmB3ETODjDGACyBUue4mLFmSGKewtn
C984zsRi49wO3JgPskrs_DkWLTWb_jblyJCNqT4OG8vnQDYGlvUuxGAvIKPwMPJFptZ_o7pl1lG5
.EYXMXbyL81V4IRA.Jk8WbdvmBliCdseM9LsVUOPyrQhcq2M5PgbBnNVgA_gO1XwXgJ4nKw7p8Oy
cqLsGqHuqfW.xBC8Sh2SpLYSH3b6QrTK9qNqwiJPA3dtFag298TwfkuihMH4sXOs4V9KVFDscrgj
4lKyQ6XRow8H97ftRbrfBuugZUw--
X-Sonic-MF: <avigross@verizon.net>
In-Reply-To: <YiFCPlGC+2aRIR0K@shallowsky.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: <21739669.459456.1646348879560@mail.yahoo.com>
X-Mailman-Original-References: <CALq4Z0-fJk-HOu0ka2kPrOioPYAh3e3zbziwetUDmAAx1U1LMw@mail.gmail.com>
<YiFCPlGC+2aRIR0K@shallowsky.com>
 by: Avi Gross - Thu, 3 Mar 2022 23:07 UTC

The drumbeat I keep hearing is that some people hear/see the same word as implying something else. ELSE is ambiguous in the context it is used.

And naturally, since nobody desperately wants to use non-reserved keywords, nobody seems ready to use a word like INSTEAD instead.

Ideally, a language should be extendable and some languages like R allow you to place all kinds of things inside percent signs to make new operators like %*% or %PIPE% ...

Just because some feature may be wanted is not a good reason to overly complicate a language. Can you imagine how hard it would be both to implement and read something like:

....
ELSE:
...
OK:
...
FINALLY:
...
ULTIMATELY:
...

What if multiple of things like the above example need to be triggered in some particular order?

I have to wonder if some new form of wrapper might have made as much sense as in you wrap your loop in something that sets up and traps various signals that are then produced under conditions specified such as the loop not being entered as the starting condition is sort of null, or an exit due to a break or simply because the code itself throws that signal to be caught ...

This reminds me a bit of how some programs add so much functionality because someone thought of it without wondering if anyone (including the ones who sponsored it) would ever want to use it or remember it is there or how. I recall how a version of emacs had a transpose-letter function so after typing "teh" you could hit control-t and a little mock LISP macro would go back and co a cut and go forward and do a paste and leave the cursor where it was. That was sometimes useful, but often just as easy to backspace and retype. But I recall gleefully adding a transpose for words, sentences, paragraphs and was going to add more but I was running out of keystrokes to bind them to and besides it can be fairly easy to select items and yank them and move to where you want them and replace them.

To make changes in a language is sometimes really expensive but also dangerous. A "free" language must be added to sparingly and with so many requests, perhaps only a few non bug-fixes can seriously be considered.

-----Original Message-----
From: Akkana Peck <akkana@shallowsky.com>
To: python-list@python.org
Sent: Thu, Mar 3, 2022 5:33 pm
Subject: Re: Behavior of the for-else construct

computermaster360 writes:
> I want to make a little survey here.
>
> Do you find the for-else construct useful?

No.

> Have you used it in practice?

Once or twice, but ended up removing it, see below.

> Do you even know how it works, or that there is such a thing in Python?

I always have to look it up, because to my mind, "else" implies
it does something quite different from what it actually does.

Which means that even if I worked hard at memorizing what it does,
so I didn't have to look it up, I still wouldn't use it in code,
because I want my code to be easily readable (including by future-me).
for..else makes code difficult to understand by anyone who doesn't
use for..else frequently: they might be misled into misunderstanding
the control flow.

        ...Akkana

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

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor