Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Remember the good old days, when CPU was singular?


devel / comp.lang.python / New assignmens ...

SubjectAuthor
* New assignmens ...Paulo da Silva
`* Re: New assignmens ...Stefan Ram
 +* Re: New assignmens ...Jon Ribbens
 |+* Re: New assignmens ...Chris Angelico
 ||+* Re: New assignmens ...Paulo da Silva
 |||+* Re: New assignmens ...Stefan Ram
 ||||+- Re: New assignmens ...O365 Dict
 ||||+- Re: New assignmens ...dn
 ||||+- Re: New assignmens ...Chris Angelico
 ||||+- Re: New assignmens ...Antoon Pardon
 ||||+- Re: New assignmens ...Peter J. Holzer
 ||||+- RE: New assignmens ...Avi Gross
 ||||`- Re: New assignmens ...Chris Angelico
 |||+* Re: New assignmens ...Chris Angelico
 ||||`* Re: New assignmens ...Jon Ribbens
 |||| +* Re: New assignmens ...Chris Angelico
 |||| |+- Re: New assignmens ...Jon Ribbens
 |||| |`* Re: New assignmens ...Alan Bawden
 |||| | +- Re: New assignmens ...Chris Angelico
 |||| | `- Re: New assignmens ...Antoon Pardon
 |||| `- Re: New assignmens ...Ethan Furman
 |||+- Re: New assignmens ...Chris Angelico
 |||+- Re: New assignmens ...Chris Angelico
 |||+- RE: New assignmens ...Avi Gross
 |||`- Re: New assignmens ...Antoon Pardon
 ||`* RE: New assignmens ...Avi Gross
 || `- Re: New assignmens ...Stefan Ram
 |+- Re: New assignmens ...dn
 |+* Re: New assignmens ...dn
 ||`* Re: New assignmens ...Greg Ewing
 || `- Re: New assignmens ...dn
 |+- Re: New assignmens ...Chris Angelico
 |+- Re: New assignmens ...Antoon Pardon
 |`* Re: New assignmens ...Chris Angelico
 | `- Re: New assignmens ...Paul Rubin
 +- Re: New assignmens ...Antoon Pardon
 `- RE: New assignmens ...Avi Gross

Pages:12
New assignmens ...

<skuu31$175k$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!aioe.org!r2jfXpftVyFE0Vzaeaalag.user.46.165.242.75.POSTED!not-for-mail
From: p_d_a_s_...@nonetnoaddress.pt (Paulo da Silva)
Newsgroups: comp.lang.python
Subject: New assignmens ...
Date: Fri, 22 Oct 2021 18:57:52 +0100
Organization: Aioe.org NNTP Server
Message-ID: <skuu31$175k$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="40116"; posting-host="r2jfXpftVyFE0Vzaeaalag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Firefox/78.0 Thunderbird/78.13.0
Content-Language: en-US
X-Notice: Filtered by postfilter v. 0.9.2
X-Mozilla-News-Host: news://nntp.aioe.org:119
 by: Paulo da Silva - Fri, 22 Oct 2021 17:57 UTC

Hi!

Why doesn't this work
if (self.ctr:=self.ctr-1)<=0:
while this works
if (ctr:=ctr-1)<=0:

Thanks

Re: New assignmens ...

<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: 22 Oct 2021 18:14:31 GMT
Organization: Stefan Ram
Lines: 10
Expires: 1 Dec 2021 11:59:58 GMT
Message-ID: <assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
References: <skuu31$175k$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de m4jYL93WJ1KJb+blzQBSnwl1mYR6ODIHU6sEPlhQd7UvFF
X-Copyright: (C) Copyright 2021 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Fri, 22 Oct 2021 18:14 UTC

Paulo da Silva <p_d_a_s_i_l_v_a_ns@nonetnoaddress.pt> writes:
>Why doesn't this work
> if (self.ctr:=self.ctr-1)<=0:
>while this works
> if (ctr:=ctr-1)<=0:

assignment_expression ::= [identifier ":="] expression,
but the attribute references "self.ctr" is no identifier!

Re: New assignmens ...

<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jon+use...@unequivocal.eu (Jon Ribbens)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Fri, 22 Oct 2021 19:15:01 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
Injection-Date: Fri, 22 Oct 2021 19:15:01 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="291435d6d180eb46cbe0d77bcbcd0855";
logging-data="19970"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+rJzZUfqRU1uYlPn4RmBh1AAhsyhPvcbI="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:cRdPhGlPSReQ9EmxDBboNP7vw/A=
 by: Jon Ribbens - Fri, 22 Oct 2021 19:15 UTC

On 2021-10-22, Stefan Ram <ram@zedat.fu-berlin.de> wrote:
> Paulo da Silva <p_d_a_s_i_l_v_a_ns@nonetnoaddress.pt> writes:
>>Why doesn't this work
>> if (self.ctr:=self.ctr-1)<=0:
>>while this works
>> if (ctr:=ctr-1)<=0:
>
> assignment_expression ::= [identifier ":="] expression,
> but the attribute references "self.ctr" is no identifier!

This seems a surprising omission. You'd expect at least 'attributeref'
and 'subscription' to be allowed, if not the whole of 'target'.

Re: New assignmens ...

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

  copy mid

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

  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: New assignmens ...
Date: Sat, 23 Oct 2021 06:34:59 +1100
Lines: 25
Message-ID: <mailman.9.1634931312.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de o+HfQ11PLpgWhgiAAHKoawfMH4s7oJUMsDWxhG7qg52g==
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=TXYNKP+7;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.046
X-Spam-Evidence: '*H*': 0.91; '*S*': 0.00; 'ram': 0.07; 'aspect':
0.09; 'rejected': 0.09; 'writes:': 0.09; 'afterwards': 0.16;
'chrisa': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris
angelico': 0.16; 'relaxing': 0.16; 'surprising': 0.16; 'wrote:':
0.16; 'to:addr:python-list': 0.20; 'sat,': 0.22; 'seems': 0.26;
'stefan': 0.26; 'expect': 0.28; 'it,': 0.29; 'whole': 0.30;
'attempt': 0.31; "doesn't": 0.32; 'expand': 0.32; 'python-list':
0.32; 'to:name:python': 0.32; 'message-id:@mail.gmail.com': 0.32;
'but': 0.32; 'header:In-Reply-To:1': 0.34; 'received:google.com':
0.34; 'from:addr:gmail.com': 0.35; 'people': 0.36; "skip:' 10":
0.37; 'received:209.85': 0.37; 'received:209': 0.39; 'least':
0.39; 'want': 0.40; "you'd": 0.64; 'your': 0.64; 'primary': 0.67;
'2021': 0.71; 'highly': 0.78; 'allowed,': 0.84; 'attribute': 0.84;
'jon': 0.84; 'scared': 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;
bh=S83w7ialFsLcv0z8pHingrteeQiYP9QM4+wj6Six/ng=;
b=TXYNKP+7N5pPrcIm3xGndXDYbbKZMUD7Kzg5/5Jc3WspNajQpmwubG4i9IJmRcruo6
OfMRqkt6A3zScWqf5RjCyFCKg/7XuVlCIha4fNqFVcYpTLEoTP+UyaIFFu58rWacqve7
KCCwR7C9I6WZsTSL4v2lgke32rrUufIcMDDmrRCa3EZS3Dt4a8srfUZ7OvqDtCeDy9gB
suhgzN/uSZr0BOHnopc8spcq5rnGFS/Beb2+G3L7WLNhPcM7PAXVmwUDl9U8zK26rIFt
GrsCvQ4Aj9smLdMff6h/yWKgCNzNgPzmyleFyxX+79WX64hrWFioBbM1dwz2a70bw9Ko
Ezzw==
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;
bh=S83w7ialFsLcv0z8pHingrteeQiYP9QM4+wj6Six/ng=;
b=owPBSCFa4dJXOmJE5+kLaufr5QDEmUuznjXx+WfbdtxOMsGtZjQNLgA4dphf8EDDSz
np5VwK+6XSPtO/2xIqieIjqDpp4RYGzsXeSal0EbUDPPwJS4FtLQfdNeQJ1wD0KNEb0Z
6HVvvJsrJa2kiwrPhC2W/hUXfKnzRlJSkQ0ihyTA7tQjCccEEzNUsSY+0WZ3DhT4Tw0U
V0pEyOIpGAsTyeosO38Zg+rUxqb/RK7RIXKq8AK7iZCx7u9JMJxOLRZ0Bg8vE+AiWlVK
zBgTyy/K+bspy9mAFlG3PMDxLjlbZ3Tpb+8iXq6ngZEUlIvGmkJzlsaH+FSzJ2vCqAg4
eXcA==
X-Gm-Message-State: AOAM532sdoZQk8E0UXkGUzyeLR1AfIg7THSSun8QhVX7ZOGCMsIp8Jua
MlOmkMDywwr5vP5rQ4GnjzpNZDnMUBBtvM+pZC7W2OWuoNs=
X-Google-Smtp-Source: ABdhPJws5HaYG8yqJ8Nln8j+CuVQ5NAD3Z1DAz3xKB5uJCvfkOxRmkPgO81NSV0kfQm0hYSqX0oq8sAeGBAApdL74O8=
X-Received: by 2002:a05:6000:1449:: with SMTP id
v9mr2220554wrx.137.1634931310730;
Fri, 22 Oct 2021 12:35:10 -0700 (PDT)
In-Reply-To: <slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
 by: Chris Angelico - Fri, 22 Oct 2021 19:34 UTC

On Sat, Oct 23, 2021 at 6:24 AM Jon Ribbens via Python-list
<python-list@python.org> wrote:
>
> On 2021-10-22, Stefan Ram <ram@zedat.fu-berlin.de> wrote:
> > Paulo da Silva <p_d_a_s_i_l_v_a_ns@nonetnoaddress.pt> writes:
> >>Why doesn't this work
> >> if (self.ctr:=self.ctr-1)<=0:
> >>while this works
> >> if (ctr:=ctr-1)<=0:
> >
> > assignment_expression ::= [identifier ":="] expression,
> > but the attribute references "self.ctr" is no identifier!
>
> This seems a surprising omission. You'd expect at least 'attributeref'
> and 'subscription' to be allowed, if not the whole of 'target'.

That's not the primary use-case for assignment expressions, and they
were highly controversial. It is much easier to expand it afterwards
than to restrict it, or to have the feature rejected because people
are scared of some small aspect of it.

If you want to propose relaxing the restrictions, make your use-case
and attempt to convince people of the value.

ChrisA

Re: New assignmens ...

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: PythonL...@DancesWithMice.info (dn)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Sat, 23 Oct 2021 08:41:04 +1300
Organization: DWM
Lines: 28
Message-ID: <mailman.10.1634931683.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<e4d16270-09a6-0853-2fb0-e2a1c91e5c34@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de MjhB6oQhQ2DMhh6In4tR9g+3+buusPIOSeg+NNgSNgaw==
Return-Path: <PythonList@DancesWithMice.info>
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=danceswithmice.info header.i=@danceswithmice.info
header.b=Yke23I9G; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.014
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'ram': 0.07; '=dn': 0.09;
'angelico': 0.09; 'aspect': 0.09; 'from:addr:danceswithmice.info':
0.09; 'from:addr:pythonlist': 0.09; 'rejected': 0.09; 'writes:':
0.09; '>>>>': 0.16; 'afterwards': 0.16; 'message-
id:@DancesWithMice.info': 0.16; 'received:51.254': 0.16;
'received:51.254.211': 0.16; 'received:51.254.211.219': 0.16;
'received:cloud': 0.16; 'received:rangi.cloud': 0.16;
'surprising': 0.16; 'wrote:': 0.16; 'to:addr:python-list': 0.20;
'sat,': 0.22; 'seems': 0.26; 'received:115': 0.26; 'stefan': 0.26;
'>>>': 0.28; 'chris': 0.28; 'expect': 0.28; 'it,': 0.29; 'header
:User-Agent:1': 0.30; 'whole': 0.30; 'header:Organization:1':
0.31; "doesn't": 0.32; 'expand': 0.32; 'python-list': 0.32; 'but':
0.32; 'header:In-Reply-To:1': 0.34; 'people': 0.36; "skip:' 10":
0.37; 'least': 0.39; 'use': 0.39; 'neither': 0.39; "you'd": 0.64;
'received:51': 0.64; 'received:userid': 0.66; 'primary': 0.67;
'2021': 0.71; 'received:localhost.localdomain': 0.76; 'highly':
0.78; 'received:localdomain': 0.81; 'allowed,': 0.84; 'attribute':
0.84; 'elements,': 0.84; 'jon': 0.84; 'scared': 0.91
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on vps517507.ovh.net
X-Spam-Level:
X-Spam-Status: No, score=-4.7 required=5.0 tests=ALL_TRUSTED,BAYES_00,
DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A autolearn=ham
autolearn_force=no version=3.4.0
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.rangi.cloud 8D0C36456
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1634931675;
bh=DPmfQWeSftSzWkTIU6E+7PHFz1aldagxA2aSX9liD0g=;
h=Subject:To:References:From:Date:In-Reply-To:From;
b=Yke23I9G48mY2uoxiHVMKNdtgqYI9bjsdlNtXtENe5wAHFlcx6C7wJEgZb6lKq/kM
VKh9SnyT3Jp3Fp3wty6dAlsyDh3QzzkkiSRILpg6jiunR0m2LiXWyA+rGZHupMp8zj
XADche/FNTyA2dQxC1lB3emh2MYJTRLVrfOfcllsnetdCCnDyMibCNr1dUmDVTBG8Y
UQ8tJjbZcxZJhoCK+vxlArwYPhcsJbBDxTHbuERo9E5Q9VLEKoklqB/L/xAJlzhMbE
O8w45SjCjGytUfjICXOMwsWQWlpzW+ZQd9QYdbLGgMUcNUIfWEHlRa38iQRFGnluOq
aYL0Z1ece/hDQ==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
In-Reply-To: <CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
Content-Language: en-GB
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <e4d16270-09a6-0853-2fb0-e2a1c91e5c34@DancesWithMice.info>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
 by: dn - Fri, 22 Oct 2021 19:41 UTC

On 23/10/2021 08.34, Chris Angelico wrote:
> On Sat, Oct 23, 2021 at 6:24 AM Jon Ribbens via Python-list
> <python-list@python.org> wrote:
>>
>> On 2021-10-22, Stefan Ram <ram@zedat.fu-berlin.de> wrote:
>>> Paulo da Silva <p_d_a_s_i_l_v_a_ns@nonetnoaddress.pt> writes:
>>>> Why doesn't this work
>>>> if (self.ctr:=self.ctr-1)<=0:
>>>> while this works
>>>> if (ctr:=ctr-1)<=0:
>>>
>>> assignment_expression ::= [identifier ":="] expression,
>>> but the attribute references "self.ctr" is no identifier!
>>
>> This seems a surprising omission. You'd expect at least 'attributeref'
>> and 'subscription' to be allowed, if not the whole of 'target'.
>
> That's not the primary use-case for assignment expressions, and they
> were highly controversial. It is much easier to expand it afterwards
> than to restrict it, or to have the feature rejected because people
> are scared of some small aspect of it.

ie neither can one use subscripted elements, eg list-elements, as the
LHS of an assignment expression.
--
Regards,
=dn

Re: New assignmens ...

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: PythonL...@DancesWithMice.info (dn)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Sat, 23 Oct 2021 08:49:09 +1300
Organization: DWM
Lines: 38
Message-ID: <mailman.11.1634932162.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<e4d16270-09a6-0853-2fb0-e2a1c91e5c34@DancesWithMice.info>
<469c6274-109d-65dd-c361-25474b5503e9@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de l8oaEBA99iNrtZ6Z/Ked6Qq7I4LZgj9Mn70oTmrKjI/A==
Return-Path: <PythonList@DancesWithMice.info>
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=danceswithmice.info header.i=@danceswithmice.info
header.b=nNM16giw; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.014
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'ram': 0.07; '=dn': 0.09;
'angelico': 0.09; 'aspect': 0.09; 'from:addr:danceswithmice.info':
0.09; 'from:addr:pythonlist': 0.09; 'rejected': 0.09; 'writes:':
0.09; '>>>>': 0.16; '>>>>>': 0.16; 'afterwards': 0.16; 'message-
id:@DancesWithMice.info': 0.16; 'print(': 0.16; 'received:51.254':
0.16; 'received:51.254.211': 0.16; 'received:51.254.211.219':
0.16; 'received:cloud': 0.16; 'received:rangi.cloud': 0.16;
'surprising': 0.16; 'wrote:': 0.16; 'to:addr:python-list': 0.20;
'sat,': 0.22; 'seems': 0.26; 'received:115': 0.26; 'stefan': 0.26;
'creating': 0.27; '>>>': 0.28; 'chris': 0.28; 'expect': 0.28;
'it,': 0.29; 'header:User-Agent:1': 0.30; 'whole': 0.30;
'header:Organization:1': 0.31; "doesn't": 0.32; 'expand': 0.32;
'python-list': 0.32; 'but': 0.32; 'header:In-Reply-To:1': 0.34;
'people': 0.36; "skip:' 10": 0.37; 'least': 0.39; 'list': 0.39;
'use': 0.39; 'neither': 0.39; 'send': 0.63; "you'd": 0.64;
'received:51': 0.64; 'received:userid': 0.66; 'primary': 0.67;
'2021': 0.71; 'received:localhost.localdomain': 0.76; 'highly':
0.78; 'received:localdomain': 0.81; 'allowed,': 0.84; 'attribute':
0.84; 'elements,': 0.84; 'jon': 0.84; 'pressing': 0.84; 'scared':
0.91
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on vps517507.ovh.net
X-Spam-Level:
X-Spam-Status: No, score=-4.7 required=5.0 tests=ALL_TRUSTED,BAYES_00,
DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A autolearn=ham
autolearn_force=no version=3.4.0
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.rangi.cloud 195BC6475
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1634932158;
bh=gO4fo8QQ0XWAo7lK+2aU8VW/NAfPmJ/CgEdOZa1jV3Y=;
h=Subject:To:References:From:Date:In-Reply-To:From;
b=nNM16giw7Ph243kciogb7qO/AWxEBwbvh46BpV6v0sd6Xj+MH1y7+YhS254Jd0YcM
sADHbsAiWMXC7ncekDCVrsW+NSrvkHBq23PD9MRjmiMjRLHrntcz/ZAh2hZva8nGzK
CBKIeO8VxKA8eqCr/bD6Ev0lzBQfYeKZTFFjJvy27Q4o1KsYc5U3RjOwdhN6nKUKom
PUxxdsiuEOKIEoP8XHeDXYaPToY5gx2Odsqnk0i/yaAkdSB4MGNVXXxsr2g3NjBw5s
GWGwyWtDJ2NsMMM2OSTOXMO2GmPP6fG8GpgMQbnDkSfFo8/LcciAivIh71UeyaGmbs
j/1K1bjdWFJ+Q==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
In-Reply-To: <e4d16270-09a6-0853-2fb0-e2a1c91e5c34@DancesWithMice.info>
Content-Language: en-GB
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <469c6274-109d-65dd-c361-25474b5503e9@DancesWithMice.info>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<e4d16270-09a6-0853-2fb0-e2a1c91e5c34@DancesWithMice.info>
 by: dn - Fri, 22 Oct 2021 19:49 UTC

With apologies for pressing Send too early...

On 23/10/2021 08.41, dn via Python-list wrote:
> On 23/10/2021 08.34, Chris Angelico wrote:
>> On Sat, Oct 23, 2021 at 6:24 AM Jon Ribbens via Python-list
>> <python-list@python.org> wrote:
>>>
>>> On 2021-10-22, Stefan Ram <ram@zedat.fu-berlin.de> wrote:
>>>> Paulo da Silva <p_d_a_s_i_l_v_a_ns@nonetnoaddress.pt> writes:
>>>>> Why doesn't this work
>>>>> if (self.ctr:=self.ctr-1)<=0:
>>>>> while this works
>>>>> if (ctr:=ctr-1)<=0:
>>>>
>>>> assignment_expression ::= [identifier ":="] expression,
>>>> but the attribute references "self.ctr" is no identifier!
>>>
>>> This seems a surprising omission. You'd expect at least 'attributeref'
>>> and 'subscription' to be allowed, if not the whole of 'target'.
>>
>> That's not the primary use-case for assignment expressions, and they
>> were highly controversial. It is much easier to expand it afterwards
>> than to restrict it, or to have the feature rejected because people
>> are scared of some small aspect of it.
>
>
> ie neither can one use subscripted elements, eg list-elements, as the
> LHS of an assignment expression.

Whereas, creating a list (or tuple...) is legal because the structure's
name is an "identifier"!

if ( l := [ 1, 2, 3 ] > [ 1, 2 ] ):
print( "True" )

--
Regards,
=dn

Re: New assignmens ...

<ith139Fkbo9U1@mid.individual.net>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: greg.ew...@canterbury.ac.nz (Greg Ewing)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Sat, 23 Oct 2021 12:51:05 +1300
Lines: 10
Message-ID: <ith139Fkbo9U1@mid.individual.net>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<e4d16270-09a6-0853-2fb0-e2a1c91e5c34@DancesWithMice.info>
<469c6274-109d-65dd-c361-25474b5503e9@DancesWithMice.info>
<mailman.11.1634932162.23718.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net EJ03ar/u9EFULuJTjQQ9aAo88ycab5Kkp7ZkPptLrjRKb6umYQ
Cancel-Lock: sha1:axbdk2idKTyzxC5JtG6XMtze4UY=
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:78.0)
Gecko/20100101 Thunderbird/78.4.0
In-Reply-To: <mailman.11.1634932162.23718.python-list@python.org>
Content-Language: en-US
 by: Greg Ewing - Fri, 22 Oct 2021 23:51 UTC

On 23/10/21 8:49 am, dn wrote:
> Whereas, creating a list (or tuple...) is legal because the structure's
> name is an "identifier"!

No, the restriction only applies to the LHS. The list construction
is on the RHS.

--
Greg

Re: New assignmens ...

<skvnes$17je$1@gioia.aioe.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!aioe.org!r2jfXpftVyFE0Vzaeaalag.user.46.165.242.75.POSTED!not-for-mail
From: p_d_a_s_...@nonetnoaddress.pt (Paulo da Silva)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Sat, 23 Oct 2021 02:10:51 +0100
Organization: Aioe.org NNTP Server
Message-ID: <skvnes$17je$1@gioia.aioe.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Info: gioia.aioe.org; logging-data="40558"; posting-host="r2jfXpftVyFE0Vzaeaalag.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Firefox/78.0 Thunderbird/78.13.0
X-Notice: Filtered by postfilter v. 0.9.2
Content-Language: en-US
 by: Paulo da Silva - Sat, 23 Oct 2021 01:10 UTC

Às 20:34 de 22/10/21, Chris Angelico escreveu:
> On Sat, Oct 23, 2021 at 6:24 AM Jon Ribbens via Python-list
> <python-list@python.org> wrote:
>>
>> On 2021-10-22, Stefan Ram <ram@zedat.fu-berlin.de> wrote:
>>> Paulo da Silva <p_d_a_s_i_l_v_a_ns@nonetnoaddress.pt> writes:
>>>> Why doesn't this work
>>>> if (self.ctr:=self.ctr-1)<=0:
>>>> while this works
>>>> if (ctr:=ctr-1)<=0:
>>>
>>> assignment_expression ::= [identifier ":="] expression,
>>> but the attribute references "self.ctr" is no identifier!
>>
>> This seems a surprising omission. You'd expect at least 'attributeref'
>> and 'subscription' to be allowed, if not the whole of 'target'.
>
> That's not the primary use-case for assignment expressions, and they
> were highly controversial. It is much easier to expand it afterwards
> than to restrict it, or to have the feature rejected because people
> are scared of some small aspect of it.
>
> If you want to propose relaxing the restrictions, make your use-case
> and attempt to convince people of the value.
>
Well, I didn't follow the discussion of this new feature, but the reason
I can see behind allowing it seems so valid for for ctr:=ctr-1 as for
self.ctr:=self.ctr-1. The kind of use is exactly the same. One is for a
normal function, the other for a method.
IMHO this makes no sense at all. Arguable may be for example LHS
ctrs[i], or something like that. But self.ctr ...! Too weird.

Thanks
Paulo

Re: New assignmens ...

<identifier-20211023022212@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: 23 Oct 2021 01:22:48 GMT
Organization: Stefan Ram
Lines: 17
Expires: 1 Dec 2021 11:59:58 GMT
Message-ID: <identifier-20211023022212@ram.dialup.fu-berlin.de>
References: <skuu31$175k$1@gioia.aioe.org> <assignment-expression-20211022191403@ram.dialup.fu-berlin.de> <slrnsn63dl.503.jon+usenet@raven.unequivocal.eu> <CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com> <mailman.9.1634931312.23718.python-list@python.org> <skvnes$17je$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de Eu6zK9i8dAsnirps8Vgf9QzwoNpQ5B65SqN485qN6eKgcT
X-Copyright: (C) Copyright 2021 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Sat, 23 Oct 2021 01:22 UTC

Paulo da Silva <p_d_a_s_i_l_v_a_ns@nonetnoaddress.pt> writes:
>Well, I didn't follow the discussion of this new feature, but the reason
>I can see behind allowing it seems so valid for for ctr:=ctr-1 as for
>self.ctr:=self.ctr-1. The kind of use is exactly the same. One is for a
>normal function, the other for a method.

The intention of the introduction of the assignment expression
was to allow grab the values of subexpressions so as to be able
to later use these value. This can be done with an identifier:

if env_base := os.environ.get( "PYTHONUSERBASE", None ):
return env_base

. I am wondering what use cases are there for having something
different than an identifier on the left side.

Re: New assignmens ...

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

  copy mid

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

  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: New assignmens ...
Date: Sat, 23 Oct 2021 12:41:55 +1100
Lines: 54
Message-ID: <mailman.12.1634953328.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@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 bgl2n9nlBfqZ/HKGMLAnGQdOy/5H/kW8UEAxuNLDrGVg==
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=AbaTFTOG;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.017
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'ram': 0.07; 'angelico':
0.09; 'aspect': 0.09; 'cases.': 0.09; 'rejected': 0.09;
'situations': 0.09; 'writes:': 0.09; 'that.': 0.15; '>>>>': 0.16;
'afterwards': 0.16; 'chrisa': 0.16; 'empty,': 0.16;
'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
"isn't,": 0.16; 'loop?': 0.16; 'relaxing': 0.16; 'surprising':
0.16; 'things:': 0.16; 'use-cases': 0.16; 'wrote:': 0.16; 'code.':
0.17; 'to:addr:python-list': 0.20; "i've": 0.22; 'sat,': 0.22;
'actual': 0.25; 'discussion': 0.25; 'seems': 0.26; 'stefan': 0.26;
'>>>': 0.28; 'chris': 0.28; 'expect': 0.28; 'sense': 0.28; 'it,':
0.29; 'whole': 0.30; 'attempt': 0.31; "doesn't": 0.32; 'expand':
0.32; 'python-list': 0.32; 'to:name:python': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; "didn't": 0.34; 'header
:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'from:addr:gmail.com': 0.35; 'people': 0.36; "skip:' 10": 0.37;
'using': 0.37; 'received:209.85': 0.37; 'received:209': 0.39;
'two': 0.39; 'least': 0.39; 'valid': 0.39; 'use': 0.39; 'block':
0.39; 'break': 0.39; 'something': 0.40; 'want': 0.40; 'follow':
0.62; 'simply': 0.63; "you'd": 0.64; 'your': 0.64; 'primary':
0.67; 'exactly': 0.68; '2021': 0.71; 'highly': 0.78; '...!': 0.84;
'allowed,': 0.84; 'attribute': 0.84; 'feature,': 0.84; 'jon':
0.84; 'behind': 0.88; 'include:': 0.91; 'scared': 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=JP2zaWzcePhaSqA34xwSLl4fSdR+gPdamAozHSrTTAE=;
b=AbaTFTOGtK8e3zI6XFBafuRvEl20K+Xwh39iqt/lMf3DRjIN3y/UIMYKiDHL3iO+WG
p0ObOKVQ4/X3uITeqf6cZrQ2Mj72SWjwzx7b29bUfEgqi4Jw+TecYlT3s3mCu1Y6NKeI
EdY2wsNGgyzz7vtHoP+bEFpBE7TYiHhhlaOt3WfdIpE3oS4QaYCnLnOAcW9sgCNWTMrX
nFOlgHGSKiOIRQEudve8pzfj1+Tb2qzbiTQ5aKXB6n2TuznQ6pmcbcVzIwJyfpqEkP6j
l4FaIHZFmkTAKNje+rSPQupUrxgba64tTQnNt+MO5+Mic4+AtZVANBtSmA2arHOnARBu
0RUQ==
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=JP2zaWzcePhaSqA34xwSLl4fSdR+gPdamAozHSrTTAE=;
b=WNhMG8U4g0Se/pjhpVT0DPbGx6coAvpDtsofemfy5hp7fKpj7aW8+DvPEa01GlCRgK
tzRL95NTuGG8MYVAr4EqsKTQQIcf+ZcMxtcdGtE1PkcuVj3wb4jo3icxboXGTlpt7eb9
QQcqtjcuAv4qlxPXlohEG9oVO/gCmxFodnhHUmHlz8f1aS+uDv09KeY483drs8U3fV1B
mPiCQWkikC5E784WcNrbsm5uCD+Dc4j/3Ja6v/9B1kcPHToq9hvh2lob3YxToQr2FtAV
QlRR2e8k4OzVFrG5pW9SEFS0NpwZtEPDd9blc3JiH/bhfPij/xPses2QBHvhxLlVIWSm
/48Q==
X-Gm-Message-State: AOAM532u7xwgvrGFCyboZD8nS/YtgRfiLe7Ob/kA0u30rICZDsofB3Yo
AqF1USqhmNJt5ervRFJxR8VWhEZy3Xe6ya/NwKoDTWJKHVU=
X-Google-Smtp-Source: ABdhPJxo8cLN7HTRzErQhcnllX19+mij8l1Cyo9Tyxwt0Id+o4MNVJgIeNx5Tf7tZIWt5o4wxs6acU+RCvLih8XrRYk=
X-Received: by 2002:a05:6000:1b90:: with SMTP id
r16mr4067069wru.153.1634953325777;
Fri, 22 Oct 2021 18:42:05 -0700 (PDT)
In-Reply-To: <skvnes$17je$1@gioia.aioe.org>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
 by: Chris Angelico - Sat, 23 Oct 2021 01:41 UTC

On Sat, Oct 23, 2021 at 12:24 PM Paulo da Silva
<p_d_a_s_i_l_v_a_ns@nonetnoaddress.pt> wrote:
>
> Às 20:34 de 22/10/21, Chris Angelico escreveu:
> > On Sat, Oct 23, 2021 at 6:24 AM Jon Ribbens via Python-list
> > <python-list@python.org> wrote:
> >>
> >> On 2021-10-22, Stefan Ram <ram@zedat.fu-berlin.de> wrote:
> >>> Paulo da Silva <p_d_a_s_i_l_v_a_ns@nonetnoaddress.pt> writes:
> >>>> Why doesn't this work
> >>>> if (self.ctr:=self.ctr-1)<=0:
> >>>> while this works
> >>>> if (ctr:=ctr-1)<=0:
> >>>
> >>> assignment_expression ::= [identifier ":="] expression,
> >>> but the attribute references "self.ctr" is no identifier!
> >>
> >> This seems a surprising omission. You'd expect at least 'attributeref'
> >> and 'subscription' to be allowed, if not the whole of 'target'.
> >
> > That's not the primary use-case for assignment expressions, and they
> > were highly controversial. It is much easier to expand it afterwards
> > than to restrict it, or to have the feature rejected because people
> > are scared of some small aspect of it.
> >
> > If you want to propose relaxing the restrictions, make your use-case
> > and attempt to convince people of the value.
> >
> Well, I didn't follow the discussion of this new feature, but the reason
> I can see behind allowing it seems so valid for for ctr:=ctr-1 as for
> self.ctr:=self.ctr-1. The kind of use is exactly the same. One is for a
> normal function, the other for a method.
> IMHO this makes no sense at all. Arguable may be for example LHS
> ctrs[i], or something like that. But self.ctr ...! Too weird.
>

I've never used ctr:=ctr-1 either, though, so I don't know the actual
use cases. Why is this being used in an assignment expression? Is it
an ersatz loop?

Common use-cases include:

if m := re.match(...):

while data := thing.read():

etc. All of them are doing exactly two things: testing if something is
empty, and if it isn't, using it in a block of code.

In what situations do you need to mutate an attribute and also test
it, and how much hassle is it to simply break it out into two lines?
The onus is on you to show that it needs to be more flexible.

ChrisA

Re: New assignmens ...

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: PythonL...@DancesWithMice.info (dn)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Sat, 23 Oct 2021 15:01:05 +1300
Organization: DWM
Lines: 22
Message-ID: <mailman.13.1634954481.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<e4d16270-09a6-0853-2fb0-e2a1c91e5c34@DancesWithMice.info>
<469c6274-109d-65dd-c361-25474b5503e9@DancesWithMice.info>
<mailman.11.1634932162.23718.python-list@python.org>
<ith139Fkbo9U1@mid.individual.net>
<e810bcb7-8475-c327-fc66-6ac11ff59c0c@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de M6HjiUZH2f0ttz1XycR+Jgdfekz8aXAtFla8gx7xDZrA==
Return-Path: <PythonList@DancesWithMice.info>
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=danceswithmice.info header.i=@danceswithmice.info
header.b=FumIxoUA; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.008
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '(for': 0.05; '"python':
0.07; '=dn': 0.09; 'from:addr:danceswithmice.info': 0.09;
'from:addr:pythonlist': 0.09; "list's": 0.09; 'applies': 0.16;
'greg': 0.16; 'message-id:@DancesWithMice.info': 0.16;
'received:51.254': 0.16; 'received:51.254.211': 0.16;
'received:51.254.211.219': 0.16; 'received:cloud': 0.16;
'received:rangi.cloud': 0.16; 'restriction': 0.16; 'wrote:': 0.16;
'to:addr:python-list': 0.20; 'language': 0.21; 'object': 0.26;
'received:115': 0.26; 'creating': 0.27; 'header:User-Agent:1':
0.30; 'am,': 0.31; 'header:Organization:1': 0.31; 'header:In-
Reply-To:1': 0.34; 'yes,': 0.35; 'addressed': 0.36; 'list': 0.39;
'skip:o 10': 0.61; 'received:51': 0.64; 'received:userid': 0.66;
'back': 0.67; 'received:localhost.localdomain': 0.76;
'construction': 0.81; 'received:localdomain': 0.81; 'attribute':
0.84; 'legal,': 0.93
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on vps517507.ovh.net
X-Spam-Level:
X-Spam-Status: No, score=-4.7 required=5.0 tests=ALL_TRUSTED,BAYES_00,
DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,NICE_REPLY_A autolearn=ham
autolearn_force=no version=3.4.0
DKIM-Filter: OpenDKIM Filter v2.11.0 mail.rangi.cloud A109544BA
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1634954477;
bh=YFPv6bu3d+6vBob3BuXp1IMH4OHqEgzxC0SOBQOni/8=;
h=Subject:To:References:From:Date:In-Reply-To:From;
b=FumIxoUANm7rEFwrRAP9hJVmzBSqvovsq+5D8UXTaSwBe59GL5VGSSxHmztUOBpR6
qPvaVTTqO1OkOJtD5cknrFtBR4Qi7ZgFxAouIeDwt856M3ZPryt5/3RsOO1VzF8hVL
vV79/jRG52UAO60PgdVK3QEAMb+1Rfwx2YS6wbDX7J+2FTfQkb1cCizEhbKfakSXIQ
SA9HPKJcY7mwx6JZZtiEeBkW1Ygs+tqqrNjv+B14Pw5zsmqs92H33s4uOOYAo1aPXG
mWyGfVyeesTJJfNGwAF9YOp7kECIJaCwEp45DWnXtHAwd0Wi5HdxMJA1yp7wjfX2P6
AUSPCnw4I3DHA==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
In-Reply-To: <ith139Fkbo9U1@mid.individual.net>
Content-Language: en-GB
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <e810bcb7-8475-c327-fc66-6ac11ff59c0c@DancesWithMice.info>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<e4d16270-09a6-0853-2fb0-e2a1c91e5c34@DancesWithMice.info>
<469c6274-109d-65dd-c361-25474b5503e9@DancesWithMice.info>
<mailman.11.1634932162.23718.python-list@python.org>
<ith139Fkbo9U1@mid.individual.net>
 by: dn - Sat, 23 Oct 2021 02:01 UTC

On 23/10/2021 12.51, Greg Ewing wrote:
> On 23/10/21 8:49 am, dn wrote:
>> Whereas, creating a list (or tuple...) is legal because the structure's
>> name is an "identifier"!
>
> No, the restriction only applies to the LHS. The list construction
> is on the RHS.

That contention (above) may have been taken slightly out-of-context.

Referring back to the previous contribution: mutating a list-element is
not legal, because just like an object's attribute addressed with
dotted-notation, a subscripted object is not regarded as an identifier.
Whereas creating a (whole) new list (for example) IS legal, because the
list's name IS an identifier.

Yes, the LHS must be an identifier - the point that was made in the
first response (quoting "Python Language Reference") and since.
--
Regards,
=dn

Re: New assignmens ...

<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jon+use...@unequivocal.eu (Jon Ribbens)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Sat, 23 Oct 2021 13:42:36 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 28
Message-ID: <slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
Injection-Date: Sat, 23 Oct 2021 13:42:36 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="eef7272aa0eaac9cc9b5a386361784c2";
logging-data="6811"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+z0oaSzKf18e7e3PS6XPU1vBBY38HBYnY="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:WelPLhjpbiIngTF9YR3laWZ3qlo=
 by: Jon Ribbens - Sat, 23 Oct 2021 13:42 UTC

On 2021-10-23, Chris Angelico <rosuav@gmail.com> wrote:
> I've never used ctr:=ctr-1 either, though, so I don't know the actual
> use cases. Why is this being used in an assignment expression? Is it
> an ersatz loop?
>
> Common use-cases include:
>
> if m := re.match(...):
>
> while data := thing.read():
>
> etc. All of them are doing exactly two things: testing if something is
> empty, and if it isn't, using it in a block of code.
>
> In what situations do you need to mutate an attribute and also test
> it, and how much hassle is it to simply break it out into two lines?

It's not hard to imagine something like:

def get_expensive(self):
return self.expensive or self.expensive := self.calculate_expensive()

> The onus is on you to show that it needs to be more flexible.

Is it though? It seems to me that the onus is on you to show that
this special case is special enough to be given its own unique
existence. It's a bit surprising that the PEP doesn't discuss this
decision at all.

Re: New assignmens ...

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!3.eu.feeder.erje.net!feeder.erje.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Sun, 24 Oct 2021 05:55:25 +1100
Lines: 61
Message-ID: <mailman.18.1635015339.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de giqRJ0mUeyzR+LBy1hzi2wsMfxvBqOZJaQxJpKevh8Hg==
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=dnret9Ol;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'def': 0.04; 'pep': 0.07;
'sun,': 0.07; 'aimed': 0.09; 'angelico': 0.09; 'cases.': 0.09;
'options,': 0.09; 'proposing': 0.09; 'set,': 0.09; 'situations':
0.09; 'syntax': 0.15; 'accepted.': 0.16; 'calculation': 0.16;
'chrisa': 0.16; 'dict': 0.16; 'duplication,': 0.16; 'empty,':
0.16; 'expressions': 0.16; 'flexibility.': 0.16; 'frequently':
0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
"isn't,": 0.16; 'loop?': 0.16; 'surprising': 0.16; 'things:':
0.16; 'though?': 0.16; 'url:peps': 0.16; 'use-cases': 0.16;
'wrote:': 0.16; 'python': 0.16; 'code.': 0.17; 'to:addr:python-
list': 0.20; 'option': 0.20; "i've": 0.22; 'basically': 0.22;
'actual': 0.25; 'seems': 0.26; 'bit': 0.27; 'chris': 0.28; 'it,':
0.29; "doesn't": 0.32; 'python-list': 0.32; 'to:name:python':
0.32; 'message-id:@mail.gmail.com': 0.32; 'proposal': 0.33;
'someone': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.35;
'change': 0.36; 'special': 0.37; 'currently': 0.37; 'using': 0.37;
"it's": 0.37; 'received:209.85': 0.37; 'hard': 0.37; 'way': 0.38;
'put': 0.38; 'read': 0.38; 'received:209': 0.39; 'two': 0.39;
'enough': 0.39; 'use': 0.39; 'block': 0.39; 'break': 0.39;
'something': 0.40; 'method': 0.61; 'limited': 0.62; 'simply':
0.63; 'key': 0.64; 'imagine': 0.64; 'thus': 0.64; 'less': 0.65;
'time.': 0.66; 'decision': 0.68; 'exactly': 0.68; '2021': 0.71;
'increased': 0.76; 'tight': 0.76; 'discuss': 0.78; 'names,': 0.81;
'known': 0.84; 'attribute': 0.84; 'jon': 0.84; 'existence.': 0.91;
'expensive': 0.91; 'include:': 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;
bh=oVMbGosx5IQSWfhk+0rH+qlxF4G+4QNXrkEPIV5JG88=;
b=dnret9OlCiv+Li6pXm7uYV3CthgXxsdU2aw689jp82eRhwFLFIevts8ENb09zzmn5n
HaKQ1V0gUxpP6vFivtCSkpJdjJ86XESEKvZQ40l9dszyRfHuXZkhdu/DcAev+lpqm2tY
QQyAubh5SNkXbTKr2EzSLKY91fJw4l0T4s8NIK5Aiw6Bq0Ahs0UvqNKvRaSJbKjM8WMH
uR3xAgYgTpraPjX4cZV0agzh9bZ3MfUxkKbCtVbVRib1I/HwGO9HZ2+5PLMGv1K5hGoX
eWologM01Q4aQxPETd2N600KOVq2OIBprlZzAF0R5Zw/TBJ5T7E7gJeclV9YezxD7FFQ
e4XA==
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;
bh=oVMbGosx5IQSWfhk+0rH+qlxF4G+4QNXrkEPIV5JG88=;
b=IEt2Rad/w2LL+wVPw17J2GQ40FyCtW8x6ZkPsICALjmIqRO158//A2hBiNHqMX+8o6
zoOFg8jGzeGCi4SLuonN7vSDnpic5M+auHAuPCOczejkrWMjYrCux5mldb+1BAwHuUkA
kaSC3LujlbobdBRgSf7+7gjvlEm0Ukif9JXrE9yesuY9sB89aYOypan0kvJESUFJPiA8
i2itQUqvmrbL5of6jJTNIJ1Hhzr/oRGiK72oO4joGSJ7V3di/OkXDZLCnCBFBvtDgCGF
Ny1Au3Ctb/Prw2qCTvdj9PD1O5t1FX+97prF3ZiVduVbh1hFX4mA674MJ4UDokW9avJL
HLNw==
X-Gm-Message-State: AOAM531UrwxFhjxfyl5ju2Fz0LSYlQFtvX/kYWJzKE2lLX0jrZ7g+DeD
zdq2wYb03iT/bDPDnyuKSsvmuDNe3MR6tCWDHKjz/xCRUISktA==
X-Google-Smtp-Source: ABdhPJwuE9Il1QjYcNU4Z8zZfDX/dwm6Xgj1CUvMINxPwtu6g77ZoJ1fc5S2tdwNDLQV+226jyY2ZLt1JqGQrRifkOo=
X-Received: by 2002:a1c:f402:: with SMTP id z2mr39178255wma.53.1635015337079;
Sat, 23 Oct 2021 11:55:37 -0700 (PDT)
In-Reply-To: <slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
 by: Chris Angelico - Sat, 23 Oct 2021 18:55 UTC

On Sun, Oct 24, 2021 at 4:39 AM Jon Ribbens via Python-list
<python-list@python.org> wrote:
>
> On 2021-10-23, Chris Angelico <rosuav@gmail.com> wrote:
> > I've never used ctr:=ctr-1 either, though, so I don't know the actual
> > use cases. Why is this being used in an assignment expression? Is it
> > an ersatz loop?
> >
> > Common use-cases include:
> >
> > if m := re.match(...):
> >
> > while data := thing.read():
> >
> > etc. All of them are doing exactly two things: testing if something is
> > empty, and if it isn't, using it in a block of code.
> >
> > In what situations do you need to mutate an attribute and also test
> > it, and how much hassle is it to simply break it out into two lines?
>
> It's not hard to imagine something like:
>
> def get_expensive(self):
> return self.expensive or self.expensive := self.calculate_expensive()

I usually write this sort of thing the other way:

def get_expensive(self, key):
if key not in self.cache:
self.cache[key] = ...
return self.cache[key]

and then if you don't like the duplication, the cleanest way is to put
the expensive calculation into the __missing__ method of a dict
subclass.

> > The onus is on you to show that it needs to be more flexible.
>
> Is it though? It seems to me that the onus is on you to show that
> this special case is special enough to be given its own unique
> existence. It's a bit surprising that the PEP doesn't discuss this
> decision at all.

The PEP was accepted. Thus it is now up to someone proposing a change
to show that the change is worthwhile.

Python has frequently started with a more restricted rule set, with
the option to make it less restricted in the future. Case in point:
Decorator syntax used to be limited to a small set of options, aimed
at the known use-cases at the time. Then very recently, that was
opened up to basically any expression.

https://www.python.org/dev/peps/pep-0614/

Read over that document for an excellent example of how to take a
tight proposal and recommend that it be made more flexible. Assignment
expressions are currently in the restricted form, allowing only simple
names, and it's up to you to propose and demonstrate the value of the
increased flexibility.

ChrisA

Re: New assignmens ...

<slrnsn8n8r.503.jon+usenet@raven.unequivocal.eu>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jon+use...@unequivocal.eu (Jon Ribbens)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Sat, 23 Oct 2021 19:06:03 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 55
Message-ID: <slrnsn8n8r.503.jon+usenet@raven.unequivocal.eu>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
Injection-Date: Sat, 23 Oct 2021 19:06:03 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="eef7272aa0eaac9cc9b5a386361784c2";
logging-data="19940"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ipR7cYOWs3wHKbOkJSRVgq3H1Qob1494="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:3heZnuosnuic6gein375dmEPkwk=
 by: Jon Ribbens - Sat, 23 Oct 2021 19:06 UTC

On 2021-10-23, Chris Angelico <rosuav@gmail.com> wrote:
> On Sun, Oct 24, 2021 at 4:39 AM Jon Ribbens via Python-list
><python-list@python.org> wrote:
>> On 2021-10-23, Chris Angelico <rosuav@gmail.com> wrote:
>> > In what situations do you need to mutate an attribute and also test
>> > it, and how much hassle is it to simply break it out into two lines?
>>
>> It's not hard to imagine something like:
>>
>> def get_expensive(self):
>> return self.expensive or self.expensive := self.calculate_expensive()
>
> I usually write this sort of thing the other way:
>
> def get_expensive(self, key):
> if key not in self.cache:
> self.cache[key] = ...
> return self.cache[key]
>
> and then if you don't like the duplication, the cleanest way is to put
> the expensive calculation into the __missing__ method of a dict
> subclass.

Sure, but if "there's already another way of doing it" was a winning
argument then assignment expressions wouldn't have been accepted into
the language at all.

>> > The onus is on you to show that it needs to be more flexible.
>>
>> Is it though? It seems to me that the onus is on you to show that
>> this special case is special enough to be given its own unique
>> existence. It's a bit surprising that the PEP doesn't discuss this
>> decision at all.
>
> The PEP was accepted. Thus it is now up to someone proposing a change
> to show that the change is worthwhile.
>
> Python has frequently started with a more restricted rule set, with
> the option to make it less restricted in the future. Case in point:
> Decorator syntax used to be limited to a small set of options, aimed
> at the known use-cases at the time. Then very recently, that was
> opened up to basically any expression.
>
> https://www.python.org/dev/peps/pep-0614/
>
> Read over that document for an excellent example of how to take a
> tight proposal and recommend that it be made more flexible. Assignment
> expressions are currently in the restricted form, allowing only simple
> names, and it's up to you to propose and demonstrate the value of the
> increased flexibility.

I think we're allowed to discuss things in this group without them
having to turn into formal proposals. Personally I've never written
a Python assignment expression, and I think it'll be a few years
before Python 3.8 is old enough for them to be conveniently usable.

Re: New assignmens ...

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: eth...@stoneleaf.us (Ethan Furman)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Sat, 23 Oct 2021 13:50:54 -0700
Lines: 23
Message-ID: <mailman.19.1635022259.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<ca4c83a8-f636-e6e3-9e78-999689183c44@stoneleaf.us>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de nr7aOgFJ4Gm9GbZtIofzaQRJz0q7Xom5So7kgz+RZIlQ==
Return-Path: <ethan@stoneleaf.us>
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=stoneleaf.us header.i=@stoneleaf.us header.b=mpe6H5T5;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.012
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'pep': 0.07; 'angelico':
0.09; 'received:217.70': 0.09; 'received:gandi.net': 0.09;
'received:mail.gandi.net': 0.09; 'yes.': 0.09; 'from:addr:ethan':
0.16; 'from:addr:stoneleaf.us': 0.16; 'from:name:ethan furman':
0.16; 'message-id:@stoneleaf.us': 0.16; 'pep.': 0.16; 'recall':
0.16; 'surprising': 0.16; 'though?': 0.16; '~ethan~': 0.16;
'wrote:': 0.16; 'to:addr:python-list': 0.20; 'maybe': 0.22;
'seems': 0.26; 'bit': 0.27; 'chris': 0.28; 'header:User-Agent:1':
0.30; 'am,': 0.31; "doesn't": 0.32; 'expand': 0.32; 'python-list':
0.32; 'simple,': 0.32; "i'm": 0.33; "didn't": 0.34; 'header:In-
Reply-To:1': 0.34; 'couple': 0.37; 'special': 0.37; "it's": 0.37;
'enough': 0.39; 'back': 0.67; 'received:217': 0.67; 'decision':
0.68; 'further': 0.69; 'discuss': 0.78; 'jon': 0.84; 'surprised':
0.84; 'existence.': 0.91; 'was,': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stoneleaf.us;
s=gm1; t=1635022257;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references;
bh=rZ1+0vxEoFGTKk4OGZN4ob7jnDiWrU8iH2mHp5HU7uQ=;
b=mpe6H5T5Le6Q6w/6O/n90YFufhmBpOtPC7Dzlo7J7yJKNrkdLA2WZmQ3nwn4wKR9NRGlUv
hrsvqsCj7Xrw/dzXZeq8rgmsNoZTuaaFEaVqiFSXt4qiI4yPvmryllVbaqv3eCYkvmjkOW
bGRJzF3hjapEudLuYhXmpYHlQFhhU/2YjUpZvCxDmUgfHzD4cnKTtIRmasZNPhR+USzR2Q
Sko9Z0nDwYdqbB2dYzoThOapzPMstB2mTTgD9fgLuxcPy5QJWVvlMKoDCfCaPtKYugKD2O
b0N70L0zX2zSc586s4YbiJpPTTbeQMwZvQa1iK2YrSlKO2ME+GplBWJ4dqCDsw==
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
Thunderbird/68.10.0
In-Reply-To: <slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
Content-Language: en-US
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <ca4c83a8-f636-e6e3-9e78-999689183c44@stoneleaf.us>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
 by: Ethan Furman - Sat, 23 Oct 2021 20:50 UTC

On 10/23/21 6:42 AM, Jon Ribbens via Python-list wrote:
> On 2021-10-23, Chris Angelico wrote:

>> The onus is on you to show that it needs to be more flexible.
>
> Is it though?

Yes.

> It seems to me that the onus is on you to show that
> this special case is special enough to be given its own unique
> existence.

It already has existence, so no further proof is needed.

> It's a bit surprising that the PEP doesn't discuss this
> decision at all.

In conversations as long as that one was, I'm not surprised this and maybe a couple other options didn't make it back to
the PEP. Nevertheless, I recall the decision to start simple, and expand later if needed.

--
~Ethan~

Re: New assignmens ...

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

  copy mid

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

  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: New assignmens ...
Date: Sun, 24 Oct 2021 08:05:21 +1100
Lines: 62
Message-ID: <mailman.20.1635023133.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<slrnsn8n8r.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmpsnLxg21dyC8ehAhF6EM6X=1_gDRqRJYMSkP4ckCTHTQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de 0smXfMJgZrBimHAUSXmdug/TtcN7WnOVxlmKIXrIjqyQ==
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=E6d8zaLp;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.022
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'argument': 0.04; 'def':
0.04; '3.8': 0.05; 'improvement': 0.05; 'formal': 0.07; 'pep':
0.07; 'sun,': 0.07; 'angelico': 0.09; 'it"': 0.09; 'situations':
0.09; '"is': 0.16; 'calculation': 0.16; 'chrisa': 0.16; 'dict':
0.16; 'duplication,': 0.16; 'expressions': 0.16; 'flexibility.':
0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16;
'hassle,': 0.16; 'proposals.': 0.16; 'somewhat': 0.16; 'wrote:':
0.16; 'python': 0.16; 'to:addr:python-list': 0.20; 'language':
0.21; 'written': 0.22; "i've": 0.22; 'matter.': 0.26; 'old': 0.27;
'chris': 0.28; 'etc': 0.28; 'it,': 0.29; 'think': 0.32; "doesn't":
0.32; 'question': 0.32; 'logical': 0.32; 'personally': 0.32;
'python-list': 0.32; 'to:name:python': 0.32; "wouldn't": 0.32;
'message-id:@mail.gmail.com': 0.32; 'but': 0.32; 'there': 0.33;
'proposal': 0.33; 'someone': 0.34; 'header:In-Reply-To:1': 0.34;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.35; "we're":
0.35; 'room': 0.36; 'currently': 0.37; 'really': 0.37; "it's":
0.37; 'received:209.85': 0.37; 'hard': 0.37; 'way': 0.38; 'put':
0.38; 'read': 0.38; 'received:209': 0.39; 'two': 0.39; 'enough':
0.39; 'use': 0.39; 'break': 0.39; 'something': 0.40; 'want': 0.40;
'method': 0.61; "there's": 0.61; 'proposal.': 0.62; 'reasonable':
0.62; 'showing': 0.62; 'involved': 0.63; 'simply': 0.63; 'key':
0.64; 'imagine': 0.64; 'years': 0.65; 'etc,': 0.69; 'showed':
0.69; 'them,': 0.70; '2021': 0.71; 'increased': 0.76; 'tight':
0.76; 'discuss': 0.78; 'names,': 0.81; 'extra': 0.84;
'absolutely': 0.84; 'attribute': 0.84; 'improvement.': 0.84;
'jon': 0.84; '"how': 0.91; 'expensive': 0.91; 'winning': 0.95
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;
bh=5z3I+9RIBv/IYjKAXNjHdWDblaRQhZIWveUQlf+asf4=;
b=E6d8zaLp+9hmh7famR8+m1oKtO5nbJ4945T8FwZzS58d6o1Vt0iBhxDqD7KSRJr20g
y9Egq/yz/PBvYmUcEU0Vj5/f1vNOXuohhvsLWda3/guBAAYskPeEPyG6QpqQqOL3ZN+D
LAY7VyMI0BP76fneb7yunM7XLCbFuAQ7q2FOdN4t0lzzzt7pnaQUau3dHJvTUh/FcOtK
IzCaBIUPXLGkv35PpiGHh3cIvnoIfgqZu4h5pZPwYsU2yEzCu6fSFW998OSHSWmuCZT3
js5yDneXeqkmDuJn8BPvN+Ni/ZvHvzdV64sMXOvAZUNxjrzBQxiTDLGCpCsj7szNlzt/
equA==
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;
bh=5z3I+9RIBv/IYjKAXNjHdWDblaRQhZIWveUQlf+asf4=;
b=GOcMDGLbXFh23/gfMul+Vy6BKTyfWmoJq/ZS/B7FEqrbk6QOAk+ijkUjW6z3i4oCCk
erQaWRCg7Pz7wEnC2adiMKorCBDi5V66ouG8VxPVZjACbFgsDF8OOmpMOg/0zribJcLW
sfeBqSvtzFf6lRv4fnQ9cIwAx2x7wKduAhFfSMyhasEdpMYvBepXHUOHFHZxah39qqLw
Hq0O8D6Zdlb7/gpZm9s0gg2AAyk7AkuXmtRsKXKlxQKNpWgnHWZcbj4ulgorgGu+ssaC
0gj0+8bAUGobzPoyiadfHI6jlLouMbm5ZcRhQh5WN9M/8gg1WkKRFJXKI2RHQM7VEEzR
c36g==
X-Gm-Message-State: AOAM533mxproRnAEJY/tHD/b9pDQ6qDKNb0v3+yqx/gyVHRSOffx+oep
d8dk+p4IWD6HzbzMO68JfpSlclA+4PfIoAWLf+s0CzqU
X-Google-Smtp-Source: ABdhPJxlzdJpziCJiSQD11hayHZY3LFJxuL2dQKyb60/9MgRJKobJSkhuI4cZ3OP6hP3ypL74fYEnI1POa5dmzC0UAk=
X-Received: by 2002:a05:6000:1b90:: with SMTP id
r16mr10036457wru.153.1635023131961;
Sat, 23 Oct 2021 14:05:31 -0700 (PDT)
In-Reply-To: <slrnsn8n8r.503.jon+usenet@raven.unequivocal.eu>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <CAPTjJmpsnLxg21dyC8ehAhF6EM6X=1_gDRqRJYMSkP4ckCTHTQ@mail.gmail.com>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<slrnsn8n8r.503.jon+usenet@raven.unequivocal.eu>
 by: Chris Angelico - Sat, 23 Oct 2021 21:05 UTC

On Sun, Oct 24, 2021 at 7:48 AM Jon Ribbens via Python-list
<python-list@python.org> wrote:
>
> On 2021-10-23, Chris Angelico <rosuav@gmail.com> wrote:
> > On Sun, Oct 24, 2021 at 4:39 AM Jon Ribbens via Python-list
> ><python-list@python.org> wrote:
> >> On 2021-10-23, Chris Angelico <rosuav@gmail.com> wrote:
> >> > In what situations do you need to mutate an attribute and also test
> >> > it, and how much hassle is it to simply break it out into two lines?
> >>
> >> It's not hard to imagine something like:
> >>
> >> def get_expensive(self):
> >> return self.expensive or self.expensive := self.calculate_expensive()
> >
> > I usually write this sort of thing the other way:
> >
> > def get_expensive(self, key):
> > if key not in self.cache:
> > self.cache[key] = ...
> > return self.cache[key]
> >
> > and then if you don't like the duplication, the cleanest way is to put
> > the expensive calculation into the __missing__ method of a dict
> > subclass.
>
> Sure, but if "there's already another way of doing it" was a winning
> argument then assignment expressions wouldn't have been accepted into
> the language at all.

There is always another way of doing it. The question is not so much
"is this something that's currently absolutely impossible?" but more
"how ugly is the current way of doing things?". Ugly is, of course,
somewhat subjective, but if the current way of doing things involves a
lot of extra hassle, or is error-prone, etc, etc, then there's room to
show improvement.

The original PEP showed this improvement in ways that involved simple
names. Expanding on this is a separate proposal.

> > Read over that document for an excellent example of how to take a
> > tight proposal and recommend that it be made more flexible. Assignment
> > expressions are currently in the restricted form, allowing only simple
> > names, and it's up to you to propose and demonstrate the value of the
> > increased flexibility.
>
> I think we're allowed to discuss things in this group without them
> having to turn into formal proposals. Personally I've never written
> a Python assignment expression, and I think it'll be a few years
> before Python 3.8 is old enough for them to be conveniently usable.

Well, if you don't use them, then you don't really have a horse in
this race, so it doesn't matter. Someone who *does* want to make use
of them can read over that document etc etc, and demonstrate the value
of the proposal.

BTW, it doesn't have to be a "formal proposal" in any sense; it just
needs to be a logical and reasonable argument showing the value of the
improvement (or the problems with the status quo).

ChrisA

Re: New assignmens ...

<86sfwqhnai.fsf@williamsburg.bawden.org>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: ala...@csail.mit.edu (Alan Bawden)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Sun, 24 Oct 2021 03:52:53 -0400
Organization: ITS Preservation Society
Lines: 26
Message-ID: <86sfwqhnai.fsf@williamsburg.bawden.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: reader02.eternal-september.org; posting-host="2bc2b998922b4038de4a56f1781b8189";
logging-data="20378"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18DjplMvtboztGOS7lMm3jh"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)
Cancel-Lock: sha1:i9jLqdGvMJHLMS1Fj4HAGeST2kM=
sha1:BhE95Z/7hokByPY2Xjt8qnX4Kww=
 by: Alan Bawden - Sun, 24 Oct 2021 07:52 UTC

It seemed weird to me that only an identifier was allowed to be the
target of an assignment expression. Then it occurred to me that
function definitions are another place where only identifiers are
allowed, but where I could imagine an attributeref or a subscription
being used. E.g.

def table[i](x):
...

would mean the same thing as:

def _temp_(x):
...
table[i] = _temp_

I don't immediately see that this would screw up the grammar in any way,
so why not allow it? A `def` statement is just another form of
assignment, so just as for `:=` expressions, we should allow the target
to be as general as possible!

I'm guessing that about 70% of you will think that this is a horrible
idea, 10% of you will find it compelling, and the remaining 20% will
find themselves conflicted. You can count me in that last category...

--
Alan Bawden

Re: New assignmens ...

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: antoon.p...@vub.be (O365 Dict)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Sun, 24 Oct 2021 11:23:48 +0200
Lines: 42
Message-ID: <mailman.22.1635088304.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<identifier-20211023022212@ram.dialup.fu-berlin.de>
<fcb4f8ee-e0a1-2367-3eca-f80874fbab8c@vub.be>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de r7oXfqTAA4i7KRzNEBLbQQNi7At9tdCFpPmE2i2JOVGg==
Return-Path: <antoon.pardon@vub.be>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="1024-bit key; unprotected key"
header.d=vub.be header.i=@vub.be header.b=faxXUw8Y; dkim-adsp=pass;
dkim-atps=neutral
X-Spam-Status: OK 0.060
X-Spam-Evidence: '*H*': 0.88; '*S*': 0.00; 'expression': 0.09;
'writes:': 0.09; 'calculations': 0.16; 'case:': 0.16;
'from:addr:antoon.pardon': 0.16; 'from:addr:vub.be': 0.16;
'identifier:': 0.16; 'intention': 0.16; 'message-id:@vub.be':
0.16; 'received:40.107.8': 0.16;
'received:eur04-vi1-obe.outbound.protection.outlook.com': 0.16;
'schreef': 0.16; 'values': 0.17; 'to:addr:python-list': 0.20;
'skip:& 40': 0.22; 'discussion': 0.25; 'seems': 0.26; 'stefan':
0.26; 'done': 0.28; 'header:User-Agent:1': 0.30; 'wondering':
0.31; 'but': 0.32; 'there': 0.33; 'able': 0.34; "didn't": 0.34;
'header:In-Reply-To:1': 0.34; 'following': 0.35; 'cases': 0.36;
'could': 0.38; 'valid': 0.39; 'use': 0.39; 'something': 0.40;
'introduction': 0.61; 'skip:o 10': 0.61; 'follow': 0.62; 'clear':
0.64; 'well': 0.65; 'exactly': 0.68; 'left': 0.83; 'feature,':
0.84; 'received:eurprd01.prod.exchangelabs.com': 0.84; 'side.':
0.84; 'behind': 0.88
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=hT5eF/qMeUt6tPHqXEIyGUs85ID5tAlTjKc6mncZw/tWtZunLYF0TAu7SJnnDApbwkfbjp0I4pwz5I0kuJnO3IAIPQOrJIIcTrKIl8jt9epVMhPCCuWEugkkUSvlqyQxp8r5KA4FIvydAoNu4hQxsQ2H8+wPhwEQDuyyUfIqGk+Fvdfus60A4UMriXzUZqJQV9mUV/o/JtuD08omEWjK43AgzsfLGVjj8vINknueQcgvyddSHUGKZLnSJRCYl96u63MZS7rwXJiLRhbkWyIf/qj0rBNCohwg9YJFUYlFtiXH7kO0k4OxlnBCcuI29EC5UNCF6JIPlm0vbpWHc6+uKw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=WJVRyB5brvYmHOFjsSDItJzV2pY2RJrx3s0eRY+Fiyo=;
b=K0MVT8KP/FVXQGdl6jMSVUp7ZTIIgO6/Ai1KM8+f5KYk5DLmtxc3ZTprXy1qdUdID+Ym8pFAgIBJdWcBSRo8J2RDlpX4KYZ6//yCFNBcXBw9ZbhEnUoG73C2L+Q6Z5E/SRLkv1dyXL+0FBkZiexoPo5SHVa3HY8v+dxwzpgBsTuX4k+qlCFshFXMEgGl97F+0XfWBoxUDcT376Asn96alFOLYE6EVPiSnmlBE58snGURv89BQn0X/tucTDhWZYIhUmrQGzlZ4MewUUUBg07sX3BZgHwaTSaHT8EEhJHRzna4ePqtyl4fzIiyRhaatEnLoPLkY8U33uIrjdHuUKJ1gg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=vub.be; dmarc=pass action=none header.from=vub.be; dkim=pass
header.d=vub.be; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vub.be; s=selector1;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=WJVRyB5brvYmHOFjsSDItJzV2pY2RJrx3s0eRY+Fiyo=;
b=faxXUw8Y6bA0gvOljBNvz6pCnEOiZql3u4jMA/1VJzvMSIiB4UrcUzlbUnwLuQfBmYCqzg6MLAplXXVZU5c6u/DtHTMY5Mow2uyBdlFUu8nVEAEP1mEWZAePI0jqwxOj9hOPUb3YcujYfZOTbVSdwq+oyIDKA+Q23PCLTa3WKcM=
Authentication-Results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=vub.be;
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
In-Reply-To: <identifier-20211023022212@ram.dialup.fu-berlin.de>
Content-Language: nl-BE
X-ClientProxiedBy: AM4PR0701CA0039.eurprd07.prod.outlook.com
(2603:10a6:200:42::49) To AM0PR01MB4147.eurprd01.prod.exchangelabs.com
(2603:10a6:208:6a::12)
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: aaaa3b5b-178b-48df-c9b3-08d996d003a9
X-MS-TrafficTypeDiagnostic: AM0PR01MB3970:
X-Microsoft-Antispam-PRVS: <AM0PR01MB3970F2628687C0396DB78A9F8F829@AM0PR01MB3970.eurprd01.prod.exchangelabs.com>
X-MS-Oob-TLC-OOBClassifiers: OLM:9508;
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: wqEemG9itOKE1yD0KpwwfyKLt2XWi+fTzaUCIeuMHDnjGnQ1j3Y8yj+SMXsHzWHLNf+ZIvQx5uZN4zNh02/eqHNF9TX0FF11MDVm8SH8HyirbbEfHY0ZqkHps1vb8yInjUD3h79jOtU20UeG6B7RpqezXs4sAofxxXvMdScvhfA3GEDAzVepWAtUgLdvvLWYM/4QGVBOqwImmlgg4xwXVOtZ2J1+1EAibAeFy0ETk9mjdtFUT4CpAy4J9g4iXb9XQFMF+Lc7O+DRI12IIOg16wbMnmAZgAdHtRTAUT5ARZSf+ZHR09t89d0c9i0hE9lm0qThJs/mMVOKx9wVDFN+OWdCxRn3VHku4gOqZmxYSNwAjQYOr0M5Lh2xuirug8Xd2/UFUoq0KuoofRbqbsg1BoJu5F9MlDhrHY4bfPNiyhK0id+E1+j8wNzlxV2NVwIhDsMrjHil7+2Y5GO041WKEP+/DWbu+lAojPKRvHSRe4k1EPv2OOivWyudYItwWv30V0u5jbybGyUBwoTNvWwkDHUxG6wvP3TLimfnGHv+i3+5TmhcvsXXnfH3h/DRiaxPqxEsLK3NrBAe9x1nKVTEH4GGYxvta6w7h6x3mOSY60JYjIb0MUQ9BtS3qf60yA2gvyNGGGqItL9086po0gaN2D623MrMzHRWVU1BdpefLxnbBxwnq9P8UkyJt0LXYwpuNFkPAbN6I7m1PSNkAuqAtXxv+MDd/jaDJrTzp++y2Vk=
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:AM0PR01MB4147.eurprd01.prod.exchangelabs.com; PTR:;
CAT:NONE;
SFS:(4636009)(366004)(2906002)(6486002)(33964004)(31696002)(186003)(52116002)(508600001)(6916009)(2616005)(8676002)(8936002)(7116003)(66946007)(66476007)(66556008)(86362001)(6666004)(5660300002)(36756003)(31686004)(316002)(786003)(38100700002)(3480700007)(43740500002)(45980500001);
DIR:OUT; SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: gXSEgnEClWOGU1Pv0RAPKl1jzzaSxNYFxXgyZgs5UfqVO
0Dpc1nTYHqicqCG10VQaKO6ubYF0aJKjqBHwbwFRBgIGh
uen10n9hzCoGwMT6gft3HQ9b0RwO5HepNweNlcjKpwsnx
whFdai4BmaX00JvOuB5yVFDb1yYMCXSdwNESoyQsxdiOE
8AEfu0bSAo+26p07oG3IgBGNdQkg/4kbW+bSRZQ4RlEeQ
Oy5DlMEKnOD+hnNBTeNPswwrunOjvWw1QcvX0zg6baI6K
WFlPop9bvjwK8jnqW1JtI8CRp1xbpT5/WRDCjRHwe2yL8
WgltAdqEnOcDp5Plns4b+8QAEh2ujrC99tSyL0zUFckjk
cWbq/NqNjip1GeWeskGRrTwOIomVzJTKGM4Ut28A13krp
xSx3sQ8cPhNdvSDobU+UMal/o+7DEWt3DAirPoVXAKvB+
NAKTZLDQ0kemg1GCme2as1LHlKG/1mNbC7zskfAoGpHBg
VpsgYpU9wdQFv3wYBclm5gIIKPA9MjsAMA+4VP0m9ELBB
omFqQmvbB9L3Ps7TOemuOIe2oOhLo8+QnmXvUVSiqTUKE
z6YC7HPnbFsNfJXNPDoDSR4/IDbl6c5T8ZJZSLtAszc5n
u/ml0+CjhFPG49kZ9bRy5uoIrNLjxA9yXcnVMEDadzPMC
nMR1p+81EAqUNLEyCFTXqhR4Uqfz2jxchiH97dnkZpKxh
5BtXfca3nzxAwdJgxwLXWuL88zCewLn+fvvAaJQ1JTRPw
5jGb08E7AIGx4BqeplwtEAqBIschVuJvs3H4/SjY3WEC9
ESGXp9j29ksiV3J2o9Q1b2fI8OKNuYOTMmzdV3clTAQEl
wqs7/Cyfb7wPs9+cDBtznhsqIzCpFmHL/LlNvcNj/+rgF
88GTm0034Jc1iIvTZYSp2KJ1zegPHUCG9YxqBKSpA9HnE
aQw2cbnSb7bu89bctytff2F9bXZjuryvv/UzQx+uZbqJ/
W++9xWTubq8F9MUDskvOtB7w6eBpL3YGg19Dgee7tBNvf
YYg98iFjpFrTsPCA0RNnmD8gY+4X9dOelMXzWtSCnbWZV
ju56GtKQSReRWEp0hX/LaH4oEKCNqnJ56Gum7Ow/D7UOF
LvTuGyNQL7M9Rw0pkKre6E4ln3dC9Q95lKsxuG34Riyfu
WdzJ7hksIlCKPkOG8LyIagdiIMVDTQmPlUbBLtYYwJXFc
7Be+Kr09oOY65L5EHef0epkSSBhxzgAcVQZpd2JGZFiuz
rTbq/oFDOEkhM1Ek3NubAvavAWzwqiLc/KmFJTvl4y8ho
+slIQYLCJJPz7gwTsGGosm0EZAors5Ch9zgnRiZBdI7On
T1IWg/bJBlPXMrVhlSj24OFSOyASSVMj1YiyCII+3PMdO
tvQCKb6trb7VxRUpRGGd1W0Az7eDkGQSrd2Q5qVHi1hxQ
aX3TvEh+69JAoebDOlbcUdvdGoSPeKvMIjVjfF+pNs90T
s9nmJ5fBgO4ZRO1RqTU6fFww15I0UBxDAOvHSTQ+G9FJE
AjiUgo69gqLlDMuxUZDVB9kpUE/+cQwMkRqze7n9K8NMQ
SH9y3LAYACqH9bAOXVt0IvIPqbSwUkswb1O/B/74P1lNa
TILQVx37RfsYrZCptU4GQWgBGuvfUj4E/fih8Q5buJZyx
LTHKzjsI4LdEOJsJ6xd6Bsw4iNfz/U4QICjLLMALSg=
X-OriginatorOrg: vub.be
X-MS-Exchange-CrossTenant-Network-Message-Id: aaaa3b5b-178b-48df-c9b3-08d996d003a9
X-MS-Exchange-CrossTenant-AuthSource: AM0PR01MB4147.eurprd01.prod.exchangelabs.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2021 09:24:00.9508 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 695b7ca8-2da8-4545-a2da-42d03784e585
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 86EL91oIH0YjhwVm8W5FPjYP6rKhrSw1bEpykLjZmNRUEk7YJsXaugy/4tP8LabtruFgHg0bXWTHcNLsyR4URw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR01MB3970
X-Mailman-Approved-At: Sun, 24 Oct 2021 11:11:42 -0400
X-Content-Filtered-By: Mailman/MimeDel 2.1.35
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <fcb4f8ee-e0a1-2367-3eca-f80874fbab8c@vub.be>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<identifier-20211023022212@ram.dialup.fu-berlin.de>
 by: O365 Dict - Sun, 24 Oct 2021 09:23 UTC

Op 23/10/2021 om 03:22 schreef Stefan Ram:
> Paulo da Silva <p_d_a_s_i_l_v_a_ns@nonetnoaddress.pt> writes:
>> Well, I didn't follow the discussion of this new feature, but the reason
>> I can see behind allowing it seems so valid for for ctr:=ctr-1 as for
>> self.ctr:=self.ctr-1. The kind of use is exactly the same. One is for a
>> normal function, the other for a method.
> The intention of the introduction of the assignment expression
> was to allow grab the values of subexpressions so as to be able
> to later use these value. This can be done with an identifier:
>
> if env_base := os.environ.get( "PYTHONUSERBASE", None ):
> return env_base
>
> . I am wondering what use cases are there for having something
> different than an identifier on the left side.

Well I have the following use case:

while (temp_result := calculate_next_couple(a, b))[1]:
a, b = temp_result
more calculations

Which IMO would be clearer if I could just write:

while ((a, b) := calculate_next_couple(a,b))[1]:
more calculations

Of course it would even more clear if I could write something like:

while (a, b) := calculate_next_couple(a, b); b:
more calculations

or

do:
a, b = calculate_next_couple(a, b)
while b:
more calculations

--
Antoon.

Re: New assignmens ...

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

  copy mid

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

  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: New assignmens ...
Date: Mon, 25 Oct 2021 02:18:27 +1100
Lines: 49
Message-ID: <mailman.24.1635088720.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<86sfwqhnai.fsf@williamsburg.bawden.org>
<CAPTjJmphbTi9urae5UX=tc-pWzob1QpJv3ZmwPKn93-XnZpPWQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de xCILGHsSY7kl0J0y9c3XCgP6PQDNvsXQamYRfdM+2TlQ==
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=II0D1OHb;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.084
X-Spam-Evidence: '*H*': 0.84; '*S*': 0.00; 'this:': 0.03; 'def': 0.04;
'e.g.': 0.07; 'used.': 0.07; 'cases,': 0.16; 'chrisa': 0.16;
'definitions': 0.16; 'dispatch': 0.16; 'from:addr:rosuav': 0.16;
'from:name:chris angelico': 0.16; 'possible!': 0.16;
'received:209.85.221.49': 0.16; 'received:mail-
wr1-f49.google.com': 0.16; 'tables.': 0.16; 'wrote:': 0.16; 'it?':
0.19; 'to:addr:python-list': 0.20; 'bit': 0.27; 'function': 0.27;
'think': 0.32; 'to:name:python': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; "i'm": 0.33; 'same': 0.34;
'mean': 0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com':
0.34; 'definitely': 0.35; 'from:addr:gmail.com': 0.35; 'count':
0.36; 'mon,': 0.36; 'target': 0.36; "it's": 0.37;
'received:209.85': 0.37; 'could': 0.38; 'received:209': 0.39;
'alan': 0.40; 'define': 0.40; 'should': 0.40; '25,': 0.62; 'come':
0.62; 'imagine': 0.64; 'skip:t 20': 0.66; '70%': 0.69;
'currently,': 0.69; 'remaining': 0.69; 'truly': 0.70; '2021':
0.71; 'tools': 0.74; '10%': 0.76; 'allowed,': 0.84; 'assignment,':
0.84; 'horrible': 0.84; 'tricky': 0.84; 'weird': 0.84; 'grammar':
0.91; 'tend': 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;
bh=klMZLZggAFRLKjwFiHPLRy90C3IMzXt8WgMIg8I6LFg=;
b=II0D1OHbkj/hm8dHsfRBEIbObZCpx85GbmrULr8glmn0brrAxEasSsmYMWQpAI10xr
rgiw45gj44S/UwMZMii8s6pVBjJv+xD0DQJh5GlEiGMpWaoNE5kV5+IjHdv4UxDLIIxi
UeHKkV0gS3YTrlogt660RNeBEfm/Xe6HMpxWbZ0WqkOWPXJcWUnDrHIOMeGIuGvXPCAr
mXVAbIk2ULC9wmBs7nel0L93kFFVRrifwj59QHDeZB4hrcQmmKZh68/M4SMQZqHZLezN
ELTACn0ttmePl8kDV3CzA8G/WmlPGjoZqs/5i5TILlminDhgz+tZwEocdwjyKb1psPRQ
+y5g==
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;
bh=klMZLZggAFRLKjwFiHPLRy90C3IMzXt8WgMIg8I6LFg=;
b=D9+ILsERldq7M1a3vxsAn+6pgP1EFvYp/pOxA0T/TLGoGQmFfGGOzmUhaUg7gZgWO2
WWxmD05JpbjU3MJWk9VdpwFUen/wOmHEkOUaXP5s9prWyTJbRMwauM2cegU8axmOhmGJ
2MF8VDArQElwkMD1mATB3PaodnanuJxYxksuKnpGtFPk3Jb+lzOudBo0DJdaod29ONHb
BqEN6zjpEsseFRxx1rVvJyBqHJh1k7NMmu3txTC2JjzeoMJDjZrBoXg2yxK0c+AfLxlD
m7GmY6W6hX790vhRKObTGFtWRbylBRRzyapRFdH3YwufJ5hXVs15kIyefn4oaEPkHyMc
Il/w==
X-Gm-Message-State: AOAM530hnk32LOb/C/J1UYXFBjm/QvzVfSMBGvYTF5/xPeK5I/6x7AbH
aGEry98q40pveoJ5ZiMXyGt1kRZWLM3EMs78j9ZPe9VX
X-Google-Smtp-Source: ABdhPJzRC4wHzDsMwt+mzYmWC7GvOaCUMewlBb1hXhDERp2gfLPygsWOdHvSvJkCpASZLFnPrEKEVE3hg5gBweeM9a8=
X-Received: by 2002:adf:ec03:: with SMTP id x3mr9589189wrn.281.1635088718500;
Sun, 24 Oct 2021 08:18:38 -0700 (PDT)
In-Reply-To: <86sfwqhnai.fsf@williamsburg.bawden.org>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <CAPTjJmphbTi9urae5UX=tc-pWzob1QpJv3ZmwPKn93-XnZpPWQ@mail.gmail.com>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<86sfwqhnai.fsf@williamsburg.bawden.org>
 by: Chris Angelico - Sun, 24 Oct 2021 15:18 UTC

On Mon, Oct 25, 2021 at 2:13 AM Alan Bawden <alan@csail.mit.edu> wrote:
>
> It seemed weird to me that only an identifier was allowed to be the
> target of an assignment expression. Then it occurred to me that
> function definitions are another place where only identifiers are
> allowed, but where I could imagine an attributeref or a subscription
> being used. E.g.
>
> def table[i](x):
> ...
>
> would mean the same thing as:
>
> def _temp_(x):
> ...
> table[i] = _temp_
>
> I don't immediately see that this would screw up the grammar in any way,
> so why not allow it? A `def` statement is just another form of
> assignment, so just as for `:=` expressions, we should allow the target
> to be as general as possible!
>
> I'm guessing that about 70% of you will think that this is a horrible
> idea, 10% of you will find it compelling, and the remaining 20% will
> find themselves conflicted. You can count me in that last category...

This has come up periodically, but it's a bit tricky to define some of
the edge cases, like what the function's name should be. But it would
definitely help with building dispatch tables. Currently, I tend to
build them with a decorator:

tools = {}
def tool(f):
tools[f.__name__] = f
return f

@tool
def frobnicate(): ...

@tool
def spamify(): ...

In theory, it would be possible to do this:

def tools["frobnicate"](): ...

But I'm not sure that it's truly better.

ChrisA

RE: New assignmens ...

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

  copy mid

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

  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: New assignmens ...
Date: Sun, 24 Oct 2021 19:46:18 -0400
Lines: 69
Message-ID: <mailman.27.1635119185.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<86sfwqhnai.fsf@williamsburg.bawden.org>
<00b101d7c931$573d61e0$05b825a0$@verizon.net>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de DDL7T43PNv2q0b38lBN3eARavG4Oy1R1BYm/86zKCGAg==
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=SMNTYlxk;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.120
X-Spam-Level: *
X-Spam-Evidence: '*H*': 0.76; '*S*': 0.00; 'argument': 0.04; 'def':
0.04; 'fairly': 0.05; 'e.g.': 0.07; 'matching': 0.07; 'partial':
0.07; 'string': 0.07; 'translate': 0.07; 'used.': 0.07;
'everywhere': 0.09; 'expression': 0.09; 'url:mailman': 0.15;
'bugs': 0.16; 'bugs.': 0.16; 'definitions': 0.16; 'evaluated':
0.16; 'filename': 0.16; 'possible!': 0.16; 'received:(vzm hermes
smtp server)': 0.16; 'slow': 0.16; 'usages': 0.16; 'python': 0.16;
'october': 0.17; 'it?': 0.19; 'to:addr:python-list': 0.20;
'languages': 0.22; 'way.': 0.22; 'version': 0.23; 'code': 0.23;
'skip:- 10': 0.25; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'examples': 0.25; 'url:listinfo': 0.25;
'url-ip:188.166/16': 0.25; 'anyone': 0.25; 'function': 0.27;
'chris': 0.28; 'sense': 0.28; 'suggest': 0.28; 'error': 0.29;
'url-ip:188/8': 0.31; 'think': 0.32; 'python-list': 0.32; 'said,':
0.32; 'develop': 0.32; 'but': 0.32; "i'm": 0.33; 'there': 0.33;
'same': 0.34; 'mean': 0.34; 'header:In-Reply-To:1': 0.34;
'complex': 0.35; 'count': 0.36; 'target': 0.36; 'change': 0.36;
'those': 0.36; 'really': 0.37; 'using': 0.37; 'could': 0.38;
'means': 0.38; 'put': 0.38; 'added': 0.39; 'valid': 0.39; 'use':
0.39; 'alan': 0.40; 'wants': 0.40; 'something': 0.40; 'should':
0.40; 'higher': 0.60; 'including': 0.60; 'above': 0.62; 'from:':
0.62; 'to:': 0.62; 'reasonable': 0.62; 'once': 0.63; 'down': 0.64;
'imagine': 0.64; 're:': 0.64; 'upgrade': 0.64; 'your': 0.64;
'supply': 0.65; 'let': 0.66; 'now,': 0.67; 'priority': 0.67;
'right': 0.68; '70%': 0.69; 'fixing': 0.69; 'perfectly': 0.69;
'remaining': 0.69; 'free,': 0.70; '2021': 0.71; 'offer': 0.71;
'10%': 0.76; 'change,': 0.76; 'requested': 0.76; 'sent:': 0.78;
'period': 0.81; 'thousand': 0.84; 'allowed,': 0.84; 'allowed.':
0.84; 'assignment,': 0.84; 'characters': 0.84; 'handled': 0.84;
'horrible': 0.84; 'scarce': 0.84; 'weird': 0.84; 'dollars': 0.86;
'dollar': 0.91; 'donate': 0.91; 'exists': 0.91; 'grammar': 0.91;
'hundred': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.net; s=a2048;
t=1635119181; bh=oh/aUWYGMO8bBpLEBnJS0+8fMX+WWLIcrmDKjbp1zNA=;
h=From:To:References:In-Reply-To:Subject:Date:From:Subject:Reply-To;
b=SMNTYlxkWYmJtfy+TTYbyZ/wEoM7+I7MKSHO3H6gvPVk6t58Nq2MrTuhsemS3hpZX9uZWKmoEBA6wRo9uZ8qTbZd3H7901VR96NmufsDzlHnsMcdOoMR4Mh3SkD/hkBk7LNZix1qXfJzTE7tV9n4z6ynx3C/RD+9PRFtSSRLkPVid3b+0/bzmK9Fz6chwbtbFK0KMC9a9I9Rnh8ULPG2Q3wGUSM1SnGo8zKFFOZWdjFNRJmj6Avedb8wQJa0WIi507K3oJLzm/Obx/z8NPF0RdVEx4YbI9EHR2r9Pe4ieeQgFsyuUfLelEl/icez+wHQUcu0A3ouzYJv/MrS29WT0Q==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1635119181; bh=a4tKzqaqhI5rP9cF92eYqQTlhMW0nVdRlV+iIL0JsrK=;
h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
b=E2FhFN3gUf7nTd3VnfCquGDW2CNpV+2hLnZBW9nHH88F81QjOpweWeoNcNWTjlw8DDX63a5Y/FZ7X+xJ7KxuBUzhKypiXFpkp1joObSEAlXdGQ5b+ZFNL7ie9s0/5ppfE3xIvg4M1QzEAjT/dzE8Joc6PFnidvSVkbpBy0kX0+pxAhxrPUvpkwKBxPs9IoD767oaMdkDvqPut/HRkrF0cB0l35kw6T7ly2OOHk6lZGpztNIPYVtoXrIGOC1QzWf8ZCsnig76zYa74XG2f6qlLsx1VnGFP4EpIxx57GNkkrddR8r5m9MB9s1URCYvslnJHC0GA1GKlX+aIrQev0nlxQ==
X-YMail-OSG: 8ljBjZAVM1nVq7OTCGVH6oVSrQBhNcdDFID1nNybnY6HxfiiOs4mNQD1q.3DWtK
N7n9zYMp1niGSsnw39s_i33Jq1njHMEcj35E1xa3KTLWoQ5k08AXtFz9kyGmwPuSUO.vExEU8ZqY
1d.d.ARUX0jiX.G_77CImljbxMYJ27mFKXdAeonM_EKHxEqWb7oLnFgv_ZY.3GovvyyGJblfsBAM
GU_cBMVUnhLIXbTm4XiGgwlN0Y9piKeYtdiGUOH8s6CQQrLOIj4ms4.JyCkx_wguy0gmncVEzdbb
i4SfE.ckUjhaKy3e8vm_C1.05xO.OR6rds2E7cIDACYSipum9mw7gWPhAgxmal8nVlTbmhdyAw3R
mMu32xukx8lFgo_gXMsr4PDZGj7QiLjnuqnmAYyhHcOHuIAkTy.PtNMph_4mfpbB9q9QxHMr0II6
4EgQAAgscZ7lRioi.j8FS0I6BOekI6qeiTnJNAlL8cHp4FuytGdbBKGjK23xr_0G2idV.7mBKLsp
M4yPdz621GZ5DJFNEzv4wAAH4Dw.jVDodYXo2He9m_y0q6Yl8_xICBTb.dNklfbaX7H0P7w40JS6
IlPdyo555vBSsBYopOA6yujnDM1F5oGODUAx2RI4gd1ztTn8b4pydcSX0r86RCzP.tSB8jocQCJc
K8UKPnCJGDNM7g5V3vYnl5nXiyFSy0JI.FqOmAN7B5Y30kp_gFp6JvWaeFuRAhojKJqApB59ZWet
6xjIQ82gkQngqvYlOk3sy3vgzMniNqYPR_ZNQXjt.Z7dicO0jCxnNgPdaVS1ibEDWVsRjdJba.E4
rBU9OkpgLCMAXxDfduEFoiR_hbY3_2Tzr9Y0e5L7.2zlLuS6BKpz6aCZ5g6Wxuvrxn2Q9wIY64jI
c8lAIsMzkW4_2IsCMhv5NbQSlD4hGsqIDnixFMY2TrE13s9IxgMgIM.DEdKiHvN9R4D_MGDaEwmV
eSaL8inxWnbkc5E7XpQWD6MOR6rMRRQ0dZUy5j5Bc08rqrsmySh9kWFizJQb3QX92sFPeLcnR_nL
o3xyqmms_NPYTx9J8HvaCOV5WNlonUDhTRNNonF69NXd8bg1m1WR02wrzuyCx5CCXjhV41FOcILY
GFhYzsxbnMzzh4I_mHY79mHA_8aod7ooVAjudnOlDUBshRvl9z9GQotokFygvQ8lO0BJpv3Farlk
mSYozIDKZwJEI4DKYus6Sq8a_z8uzoHiLzsrW7F3GLKgIZGS3FfFKyEwSLjPSUI2j7rVVIsv65ik
iKF.eyWuaEvWIVD4Ll.1HXuwgfg3nkSaveIeD8BB9AcW675ZxIdc37Alzh8KG_RKTSujrI.J5Aoa
b4YvKGw2m7E.bFMjKqfQ5qN.p1PG4Xw_LTNneAQTGM.rrQDwiNXdXiJADsCO6DNYHEnWKMo0ClA_
JYaV7IlN9aESK3elT8xdbOxLgQo7Czs7HRmB9CSeXNh9jerY5Y6Obyf4Sen9..LO8JQalDP8Gahr
bkO1nGE1Jq3L2NuPb.eI5dUm9.mF9JxxuMYbHpGE3BvBdG2EIVy25Dzr6mxP7rUTSIdjCXggsA7E
mswE9pWi7KgftKk81XOFGfSinPWo4vUZ3FZ.kjSfO0Jmd2lOuBqf97W61g.ndXr2XBcIley.O873
T6YEOTg6cU9yzYtcAtSNm2C4X43NAIt1LkBf.CwxG6ZmxzWT.sD3oLiYkIfDeRizq63uF5o1ZBCw
SsnowkWxVImaPtV2aI14i.eeKGIY55YfVOmLvL6awsgCdXzOg8614.XjXkITfKKJY.zYBlTDSA9R
C4iMCYzQzfSi9JcNkPrDH5iiuVtJwwQ7SfZ50CGTizdvYnfWSnaRwJQMdCsGZauXv6iogWWse9ff
gf6zzUXbeFZaep2upLuyGvw70aEYdsoDU.yIZtinlAn1BvD96TxpAv7XQ7RFEanhTl7VdxlCPhIM
x3v8DzqIdAcetS4.zVs8rEjTfztd7ad9ZApxZkSvu9u57FB5ou.ay6G0W8vGNDtkdpG3KtGd.zND
PPqf9fzzUXOwCmI63sz9EQUzgKO0ShOoVHVOFKbq_IzUH2LJmhlqUut3Wf35r4SIrE5oaqus3TKK
SkZUgwtE0kfAluNMIyD.DWCKlxc0GQNL8ZfE.zD9SZlO6r6DGdFaJqWtrlJXNnm9dDE2G5sF9aiM
gtPJ8UBPVAH4mSp7ffW1rz9FKedyo7Par9fD8CJZpfQ--
X-Sonic-MF: <avigross@verizon.net>
In-Reply-To: <86sfwqhnai.fsf@williamsburg.bawden.org>
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQKk4BrivA+qeRYu5Hy/5CG+fHUyRgHQbedmAXajPfgBg8Lf7QK07BpZAuTejC0CCGGmIgGntibLARtch00BAzFXUADAJqJuApRaZ6yprGEpUA==
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <00b101d7c931$573d61e0$05b825a0$@verizon.net>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<86sfwqhnai.fsf@williamsburg.bawden.org>
 by: Avi Gross - Sun, 24 Oct 2021 23:46 UTC

No, many things need not be as general as possible once you consider how
much work it may take to develop code and how many bugs and oddities might
be introduced and even how much it may slow the interpreter.

I could make an argument that everywhere you can put in a character string
should also allow a regular expression but why? It makes no sense to allow
you to supply a filename to create using a regular expression as you are not
matching anything. Worse, perfectly valid string that may contain a dollar
sign or period or many other characters used in regular expression may
really be messed up if evaluated as a regular expression. So is it any
wonder NOBODY suggests the above be done?

As Chris has said, something was added to Python that is a partial
implementation. There are fairly reasonable ways to do additional things and
until recently, those were the proper and only way. But the recent change
does not preclude a later upgrade if anyone is not only convinced it is
worth doing but of higher priority than the scarce resources needed to do
lots of other worthy and requested things including fixing bugs.

I imagine you can create some fairly complex examples you can suggest should
be handled for generality including some very indirect references created
dynamically. The code to recognize any abstract use of symbols may not only
slow down every operation of even the simplest type but generate all kinds
of error messages nobody will understand, let alone translate into other
languages properly! Right now, it is simpler. An error message can say that
only certain simple usages are allowed.

Now if anyone wants to donate a few hundred thousand dollars if used to make
the change, or offer to do it free, who knows? Of course, this means anyone
using the feature may need to check your version of Python to see if the
feature exists before ...

-----Original Message-----
From: Python-list <python-list-bounces+avigross=verizon.net@python.org> On
Behalf Of Alan Bawden
Sent: Sunday, October 24, 2021 3:53 AM
To: python-list@python.org
Subject: Re: New assignmens ...

It seemed weird to me that only an identifier was allowed to be the target
of an assignment expression. Then it occurred to me that function
definitions are another place where only identifiers are allowed, but where
I could imagine an attributeref or a subscription being used. E.g.

def table[i](x):
...

would mean the same thing as:

def _temp_(x):
...
table[i] = _temp_

I don't immediately see that this would screw up the grammar in any way, so
why not allow it? A `def` statement is just another form of assignment, so
just as for `:=` expressions, we should allow the target to be as general as
possible!

I'm guessing that about 70% of you will think that this is a horrible idea,
10% of you will find it compelling, and the remaining 20% will find
themselves conflicted. You can count me in that last category...

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

Re: New assignmens ...

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: antoon.p...@vub.be (Antoon Pardon)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Mon, 25 Oct 2021 11:20:52 +0200
Lines: 36
Message-ID: <mailman.31.1635153664.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<86sfwqhnai.fsf@williamsburg.bawden.org>
<00b101d7c931$573d61e0$05b825a0$@verizon.net>
<5761dd65-4e87-8b8c-1400-edb8212048db@vub.be>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de gGaqWyziKDIIU9eulKop4Q0TM8a6P8KwkFEHVpv51/CA==
Return-Path: <antoon.pardon@vub.be>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="1024-bit key; unprotected key"
header.d=vub.be header.i=@vub.be header.b=0slV17qy; dkim-adsp=pass;
dkim-atps=neutral
X-Spam-Status: OK 0.031
X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'fairly': 0.05; 'loop':
0.07; 'translate': 0.07; 'antoon': 0.16; 'avi': 0.16; 'bugs':
0.16; 'calculations': 0.16; 'faster,': 0.16;
'from:addr:antoon.pardon': 0.16; 'from:addr:vub.be': 0.16;
'from:name:antoon pardon': 0.16; 'gross': 0.16; 'limiting': 0.16;
'message-id:@vub.be': 0.16; 'pardon': 0.16; 'slow': 0.16;
'usages': 0.16; 'wrote:': 0.16; 'to:addr:python-list': 0.20;
'languages': 0.22; 'code': 0.23; 'examples': 0.25; 'follows:':
0.26; 'organizing': 0.26; 'suggest': 0.28; 'error': 0.29; 'header
:User-Agent:1': 0.30; 'python-list': 0.32; 'develop': 0.32; 'but':
0.32; 'there': 0.33; 'header:In-Reply-To:1': 0.34; 'complex':
0.35; 'people': 0.36; 'really': 0.37; 'use': 0.39; 'still': 0.40;
'should': 0.40; 'including': 0.60; 'once': 0.63; 'down': 0.64;
'imagine': 0.64; 'less': 0.65; 'let': 0.66; 'now,': 0.67; 'right':
0.68; 'complexity': 0.69; 'strong': 0.69; 'resulting': 0.70;
'....': 0.76; 'allowed.': 0.84; 'handled': 0.84;
'received:eurprd01.prod.exchangelabs.com': 0.84; 'scope': 0.84
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=QgZHi8p/LPeSC4vIArqVr6o1rcK4riCmo9rQtwQFXG0OT3L5HFl4hANAsbKtqfRR7EsVQGCcW+8B9MPShn7tzJbcHH3NpUVP0ZFt+yHrAnqCuAUtnlaaOigQvGNQfP7IilO43xcNP1xJhHQyfXWXE8P9TNoXFNajNq2LA9SppQsRwDF7O81Kro3Wv6fPwQAViGWwjt17ZZq5mCPFFeRWM3HereMqN18Np1hseEah7nBFEznOOwCfFwSY9PZWzPfSW7Wi8x3xmtTV4pi6nb5Q21rYCcyz8TuAcLhJPIBhais/J44XP1CVrxwUpPZuiy0Y3z2ThAUlN31e/CnOFYsh9A==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=de9JH7SceRcnDUcw6O+gFVDL0GrOeLuVlmnX7CJ/ltU=;
b=Yg3YLbcb/VxJm/c9a7FQ72weBGT+dMymaDPl6CKaf0i82tpDYBce5d4pDIEwFCvC970PE9XXHjeRpUQj6I0WkJDwHraodB+O/TjqwnK7Vm956ATSoc16t61lD/46ZOgH24XSfkGC2uOdfK99m2Irqx6Eh3CJoCbvLdN7DFMUFcQihOWLMmcrDZxKMSCj60K6T1lk29HflgnAWxjuhTLEWqEayANGMdO8llAo+OlyB4yAIpdcQt8HY5M/ylzhdEyDJk4fJvVlVr+5dg2GfTaerFTZQKx38PjijJmycGpqAr3uCvLxrgnNXbg5QoF1K5qtt5msvsiqHZZMEHo5v5dbSQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=vub.be; dmarc=pass action=none header.from=vub.be; dkim=pass
header.d=vub.be; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vub.be; s=selector1;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=de9JH7SceRcnDUcw6O+gFVDL0GrOeLuVlmnX7CJ/ltU=;
b=0slV17qy7gbR+UixzyP5dGsTn2jXzkAUB7DoRNvs9OOmyIL3B47hOt2BapAAtyYnwYqfAnl2zl6OOqQM+VmQu44tXlPSfQZG0iozIcXnAe42PC21vm1ZfcnOGFp/zZcCcTQ+atUV0NoYt2zRjQZbvCIYwXv254k7/E1o4XfZyOg=
Authentication-Results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=vub.be;
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
In-Reply-To: <00b101d7c931$573d61e0$05b825a0$@verizon.net>
Content-Language: en-US
X-ClientProxiedBy: AM0P190CA0029.EURP190.PROD.OUTLOOK.COM
(2603:10a6:208:190::39) To AM0PR01MB4147.eurprd01.prod.exchangelabs.com
(2603:10a6:208:6a::12)
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 93ca529b-3087-447c-9135-08d99798c24d
X-MS-TrafficTypeDiagnostic: AM0PR01MB3825:
X-Microsoft-Antispam-PRVS: <AM0PR01MB3825B479B6504F1FE274D1E48F839@AM0PR01MB3825.eurprd01.prod.exchangelabs.com>
X-MS-Oob-TLC-OOBClassifiers: OLM:9508;
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: Yo7oePqbDYNbOop/yVpc+keuiLO4kgkOMUEs8/92jQ/eYYytula/9hTZx1k/ohd5t1kSRfW9xt8aP88OvZEA54VqiF86idBlyYbv4sh4NhkULYlHr43Ket9xH27jcClfkWieqBf6ZnMSF0axwg18kQXZs+cMZ2E3siWDrDQ885ybxE0QMflAhzFYU49KNeSLEGLSVKeejv9R0Y1VzvkKWba7gogvxIUoUDJdKAedo60YzpeEGXCzAuSKjY0f05FqLsVgjlfd/vgtm2cUXs7GLAGGmti8aMGTpQYLVOAS2a8vgrWmZ3gUUrsbKnbTrsL17DwmxEGVjaqHVg0qTBeMTW+zwcVVOJ/jGNBDCZeRLHQMU7RqWu0i98cdNtbc94ITy2z6lTh5Npf/Wt+qt2zL2RuvOHn2FX2+i9D+KkApF+qOE75AugW0DU3vrr20r+u+3E8yJZtGwD62ZBYSX9w8SmgPDGonoE+Lgd7TtmKWIZL5MG/cu819PyVztgQ/0B/PtW0+tS+ReDOnk75NE/huvREnigmmzohg7HbqaZu5Wl0JI+qbBjRHSADhNOkqkN4jfoE/T2JcJMAJDnkNYA2yyd/Q5qxiSc1GGM6MOnV1575Wb5us5b3/x2Ke+fqEhsc6ZdB12UsBlAXMEeU1em+YAGIeRVltpGuh9ieC+tPKZ6siA+VRTRnZAm4ZupyX6o1BN0OtdDCiPeKUbg2tQgFLfm/jUX4mv8Y90tnrjxgfaJ+ikMzaqt78qHNyHen74OAMwrEUwQ2I04+1HewGK/hwyw==
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:AM0PR01MB4147.eurprd01.prod.exchangelabs.com; PTR:;
CAT:NONE;
SFS:(4636009)(366004)(2906002)(6916009)(8676002)(83380400001)(66556008)(66946007)(66476007)(33964004)(2616005)(26005)(31686004)(86362001)(508600001)(6666004)(316002)(53546011)(956004)(38100700002)(6486002)(16576012)(52116002)(38350700002)(786003)(31696002)(3480700007)(44832011)(186003)(36756003)(7116003)(5660300002)(8936002)(45980500001)(43740500002);
DIR:OUT; SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: Bbiqp5qY5M9obvLcdDOQ1xCsts0BkakroByz5zeyila/g
xpZY9tlwHvGd3DpEDW97gJoxk8enFdrGjsbFDF8GTA3Le
GyrS3viUR6MmDe/s1+PIjxYhfxMMhNJeIeIqUggDY8fja
RahSZ26dsKKTJVa86PqfaeuxtHBV0HLe2wSN1TSy983St
Qp5ZdmtlX7iCYTfDVu4UNjdqo68u7Hiu80NtBn/HcCJXW
P+pQdcR4jsQosExapYWd311QObsdbGtKs5teVSGKSGwJa
8ObmufRDNtvpuUk/aGraO2ugU/GfaVtjsHemqXLAHhKvt
WVi/hM9y6r4rhNxigkH6izZgFOqI3znpCrb0J3eP9Jxex
iFng2R1/NfuCl8Ml4lBbSd7FsjPOpLoYhJVB/dDC0w+Pq
Wc3fhYnPamq5rHGOo9GJ8Na6LuftmcCtb8dHzO4HM2mpp
mBwWRRhV6sGDBoPUJQZzEDpYvkwV6bk35CFZfu2vHQOUb
PnBx/zmysOG9b3twJay25YxrZwRo+f8vy/LKM6xqtJF+o
/0CuhU7CNLTeu/sInHBle2o+wpulNgIOqcMMwMSc+6RT8
Exxsmc8cLAnkSGEHjdA4l6bf4HvREH6CkNPaqRWvMtu+d
QKEp+lvTFfBDR3j2BGQsXAks6XmEb2QB6in8TR+6UaI/u
CAF4FFXK7iTg698i2FDCRat/b5OGRRLNxpuwxy7SfjrSq
Ip7OAgvB5iN1AlSWv3a3rRkggiBqkowlL9BS8xa4EnKZT
jteXmdCeyz8WuIU+rDltdlXTWYCUzjGBj9TOK+flcOBHV
cIjS6Px8HEEy1SNAmKvkD1LMGoYAX8ZKIEfuwWnlyqAk2
S6fx8j+lHATX7m8LJNQy/1h0eqaY1VWC3pdO0kup4hhu3
Npjs8t5okhGVTMd2vzKiwsXyA5QX7rbOkG9nIMLUnaNac
Vb7DZMPQb0WJN6aA+/So55PuYQbKBa7a0EZbsI/uZQwz7
FSg9p8BrOMqMzHW50NFKjNiWqBpKMVvyJiNzp3G8soT/P
6ow7dqAPYUYj6+QT+iEWT9ZnfAgbcVBeJmABuF/1FUhiF
guHAqfxh+HOx48ph8V+iHOrdao2qr8Qf4CwOG2vK+/bcK
eyTq4bjjR9CqKdGVsfCrUpDhXH2xiYkDmf6xgxBCKaKb5
ecRCxANhCIAVTFnU3UZAdzmYUeqwonLID3adHWSonD1U0
1QSfdrzcWbDzn16cAGoAPfJP914r2W9pmm8mb0/u3Po7u
mLYDMM7THV19Sl+QXymPfUEGpZE69usy08w+FpAVPX5mP
tw9RsXqowUL91ncqwdA7VtIonMnrBv8SpprNvF3mu5avl
LRV+tAAcdbHFSHxqRb3DRiAkrdeWbCF8ISpN46x9c4lQA
BXE/Bm1+4kOJj54Qv5YNHVEsZU9PrqAQ32d8m7FdxwZ/Q
UbqY4k+kY07dr+m9m5ogoZGAIAvSZO+sw6mAii+7kMQR9
iGUrp8yOaQJ9Sm48IXrbCGZ4u61HvcFdgn6p42nkjuFAx
1Fy9VGHc/gzhsjQYjyc4a9x01hSYxrKJhfIn3y4QUHh3R
3Isv6femxDaPLa/f0ULOVOcNria4nb7gT3mLGZe9rJKfv
OSfELVf9zi70ZTWJgEZIJFk=
X-OriginatorOrg: vub.be
X-MS-Exchange-CrossTenant-Network-Message-Id: 93ca529b-3087-447c-9135-08d99798c24d
X-MS-Exchange-CrossTenant-AuthSource: AM0PR01MB4147.eurprd01.prod.exchangelabs.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2021 09:21:00.1581 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 695b7ca8-2da8-4545-a2da-42d03784e585
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: cOgx7KoG5QizMcN8X5L/rnnp8+yZ+LK6BK2GFDMpcsZFMK45EJ7Y2SJLCXNsjGg7ZIFWeRvxNfZ47AqDhe+vCQ==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR01MB3825
X-Content-Filtered-By: Mailman/MimeDel 2.1.35
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <5761dd65-4e87-8b8c-1400-edb8212048db@vub.be>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<86sfwqhnai.fsf@williamsburg.bawden.org>
<00b101d7c931$573d61e0$05b825a0$@verizon.net>
 by: Antoon Pardon - Mon, 25 Oct 2021 09:20 UTC

On 25/10/2021 01:46, Avi Gross via Python-list wrote:
> No, many things need not be as general as possible once you consider how
> much work it may take to develop code and how many bugs and oddities might
> be introduced and even how much it may slow the interpreter.
....
> I imagine you can create some fairly complex examples you can suggest should
> be handled for generality including some very indirect references created
> dynamically. The code to recognize any abstract use of symbols may not only
> slow down every operation of even the simplest type but generate all kinds
> of error messages nobody will understand, let alone translate into other
> languages properly! Right now, it is simpler. An error message can say that
> only certain simple usages are allowed.

I don't consider this a strong argument. Limiting the scope of the walrus operator
will just force people organizing there code where they will use a normal assignment.
So the resulting code will not be faster, less complex or generate less error messages
because the complexity of the assignment that is needed is still the same.

Or you force people to be "creative" as follows:

Suppose I would like to write a loop as follows:

while ((a, b) := next_couple(a, b))[1]:
do needed calculations

What I can do is write it as follows:

while [tmp := next_couple(a,b), a := tmp[0], b := tmp[1]][-1]:
do needed calculations

I really don't see what is gained by "forcing" me to right the second code over the first.

--
Antoon Pardon

RE: New assignmens ...

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

  copy mid

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

  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: New assignmens ...
Date: Mon, 25 Oct 2021 12:06:22 -0400
Lines: 155
Message-ID: <mailman.33.1635177990.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<86sfwqhnai.fsf@williamsburg.bawden.org>
<00b101d7c931$573d61e0$05b825a0$@verizon.net>
<5761dd65-4e87-8b8c-1400-edb8212048db@vub.be>
<007b01d7c9ba$417f97e0$c47ec7a0$@verizon.net>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de KyIW8RFqoUiEY5CnIBbVoAyMr8jjTOyjJ9BUeuNy7Adw==
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=qHQ89kxy;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'looks': 0.02; 'argument':
0.04; 'knows': 0.04; 'absolute': 0.05; 'fairly': 0.05;
'hopefully': 0.07; 'lets': 0.07; 'loop': 0.07; 'matching': 0.07;
'programmer': 0.07; 'simple.': 0.07; 'string': 0.07; 'tests':
0.07; 'translate': 0.07; 'can,': 0.09; 'deeper': 0.09; 'emacs':
0.09; 'expression': 0.09; 'floating': 0.09; 'objects,': 0.09;
'originally': 0.09; 'parse': 0.09; 'rarely': 0.09; 'those.': 0.09;
'though.': 0.09; 'url:mailman': 0.15; 'that.': 0.15; '98%': 0.16;
'alphabet': 0.16; 'antoon': 0.16; 'arguments': 0.16; 'avi': 0.16;
'bugs': 0.16; 'calculations': 0.16; 'chapters': 0.16; 'complete,':
0.16; 'directly,': 0.16; 'encounter': 0.16; 'enough,': 0.16;
'examination': 0.16; 'extending': 0.16; 'faster,': 0.16; 'gross':
0.16; 'interesting.': 0.16; 'languages.': 0.16; 'layers': 0.16;
'limiting': 0.16; 'ones.': 0.16; 'pardon': 0.16; 'powers': 0.16;
'recall': 0.16; 'received:(vzm hermes smtp server)': 0.16;
'repeated': 0.16; 'run-time': 0.16; 'sentences,': 0.16; 'slow':
0.16; 'something.': 0.16; 'times,': 0.16; 'usages': 0.16;
'wrote:': 0.16; 'python': 0.16; 'october': 0.17; 'values': 0.17;
'instead': 0.17; 'calls': 0.19; 'it?': 0.19; 'to:addr:python-
list': 0.20; 'language': 0.21; 'languages': 0.22; 'version': 0.23;
'code': 0.23; 'goal': 0.23; 'run': 0.23; 'idea': 0.24; '(and':
0.25; 'skip:- 10': 0.25; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'python,': 0.25; 'examples': 0.25;
'url:listinfo': 0.25; 'url-ip:188.166/16': 0.25; 'anyone': 0.25;
'clicked': 0.26; 'follows:': 0.26; 'normally': 0.26; 'object':
0.26; 'organizing': 0.26; 'pattern': 0.26; 'bit': 0.27;
'function': 0.27; 'expect': 0.28; 'mostly': 0.28; 'sense': 0.28;
'series': 0.28; 'suggest': 0.28; 'asked': 0.29; 'error': 0.29;
'takes': 0.31; 'looked': 0.31; 'url-ip:188/8': 0.31; 'do.': 0.32;
'expand': 0.32; 'fine.': 0.32; 'guess': 0.32; 'objects': 0.32;
'programmers': 0.32; 'python-list': 0.32; 'right': 0.68;
'advantages': 0.69; 'clear.': 0.69; 'complexity': 0.69; 'deeply':
0.69; 'strong': 0.69; 'reach': 0.69; 'within': 0.69; 'terms':
0.70; 'resulting': 0.70; '2021': 0.71; 'ignore': 0.71;
'interesting': 0.71; 'performance': 0.71; 'longer': 0.71;
'relevant': 0.73; 'features': 0.75; '....': 0.76; 'handles': 0.76;
'tight': 0.76; 'sent:': 0.78; 'study': 0.82; 'extra': 0.84;
'allowed.': 0.84; 'efficiency.': 0.84; 'forgotten': 0.84;
'handled': 0.84; 'inherit': 0.84; 'inheritance': 0.84;
'inherited': 0.84; 'macros': 0.84; 'penalty': 0.84; 'scope': 0.84;
'simply,': 0.84; 'situations,': 0.84; 'strings': 0.84; 'subtle':
0.84; 'time!': 0.84; 'want.': 0.84; 'dollars': 0.86; 'exists':
0.91; 'cut': 0.95
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.net; s=a2048;
t=1635177987; bh=nYVJ27zA5w3SqnC0mhfeEEfifRjYPBuyWO1t+DKh8/E=;
h=From:To:References:In-Reply-To:Subject:Date:From:Subject:Reply-To;
b=qHQ89kxyKr3D+irA1e+bckQFX6Cb8HPNuFeBQsNXGwnY3X19WC8+98eDNPs2maHQ4WwHm26GrrtUZyIsDkn2ZxhTb/V6YCYqnEdcNDsDIZEmKY+LvlYcXSr2eweZVTluaDI9B91YRgDuZRLo/l3+dSB68fo+Nk7aq5cq9W/bzynNCtNc+MCf7qN6pZSrwVdAxdv1bOXx0130n9luf91RjAsfTqg37TAlKDiu1esoCB188a5oj7WpXl4YMeOCY6Pzj4lkYWS7clRCSaCQO6ciNDSwOxWQl0zTQvBAb2hys6LJYO/DNnnzhJn4AjwBMp9/hcLBppLjNZTbfK8vyKPtjw==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1635177987; bh=7iQrlw7D7Z4ez/h6Zptgl/iOE/jRXYyo95e8Ot0xNA+=;
h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
b=f+VkAHvDm9uA363sizKzHLmbuTLV9k7m7xeOZISKFlb8ZZGNhbTPQB3vQYjuJ+YdFirO92Kg2fkM3LL2AawnhUE16HlQbe9SJNDM6tlD9iQYH8Gin/xCgLYPp3bJdFt+wFY0aW8Uu3TTSAWk+om41l2ARWVg2g2x9u8tWVChk7wz4EKW1ZmVLOPI/gY18WO0YoK0fU7eTT5FjYD4AAxaka3vwhmtSM2A1mTqGNnh9U+aP0qzt+Z5jTQUjsA6hP2dTMo9sWycjGEk5xWxDMdg4FE7ZgW8eMH3/241WGhH9pQIaD2dsk/79mbU56tT0lvfq1ohG08lTEzrKJYrRiH+wQ==
X-YMail-OSG: JnDmqnYVM1lPWXTa9Tbn5roec6MwuUqc5HUO1fvU30vBD6C2MjmjhiALIbvdG8A
prVdm6dN7uUPAcDD_GaoI87lVzXUMREuqeoDuDliemGkYO7uIKsTGkuJOmcIqBXacYoL7P4a51xa
R76pxC31zmoNXBTAbRZoYf8G7AW0XUbdZ8JNNkT4cOBQ8hbDlJ3kJDKW5m7yhOU9JcBG_3kXpsIa
Cn3PLumwSA4DOF.2IMijt80lpjgHqpIlcOVVRN1YiVp.oW2Yt5OX5NVBKCzaYBZsHsNgK9MFS72h
n5ZT_Njjp1T9uCnC2deIPRivTXMfrondj9L.74oKCjfoGTwnojcwE_eDT3kSlwNf.u6mx1SLEgYe
tAi.mhEtE0HjGofpwQ.p9ElCfDkb6OVaXIIJsaw9yZO6t4J9ydFJoZX3GpxTbaIFE7820pyg8EVB
Xv5j7KDIQU50WoiS2uZ8tVVxjWCJ3dXprvP6ujI0mKjHDTQ.Acp8alVGMdRAAF0JjU5eh.U1yUBD
Ri2cZ3qsChiLEzpswMwZ8YuwCqbNH_dLTSqm66ZLxBdT8sbvMIdvbPC0lKxC1WvJOgC2Gl6s3Y1l
bl190LKN_h_un3Tv72K3OyLlX2gakxUurVSDuLMFSqvlVohHcF3vjnltdaoWHgpwueJ3znUbJD3g
wKwDJIwSR8Mz6gUsdJIBKINHE_2uoG.4pt3XvUvd7MkjU.ZJb8pY2ClVXIhAgf3TBzcbX.0jxcrO
X2_0.sJ7y_PtH95vUCd_N4JlxYKZZ2aXPqF0RXXHmiAT6wJG.ecCJa6BDtIUFDRA1Ce0Iv94xXJ7
SLMqPF6p_ahbYQQfRlX0UzpF8ssB5u8LC1.NaW_7d6lZUaG2tz28fGaBRf2y6H5dGe1sUC04SSBe
yLzdWHRx7Z43mBT_zro0u1k21wK_dQCkLhaMcEFlgj93PNRW1RZc73iwW6DrQa5UhNF7JY5TWs63
zQ.eJW3rfg69lYh84eHaHBzPdDjMQKzQUtF_e0kSHnZfmL3Y34LP99dvmtEfidj4CIrpxcBCWtPF
7MKByK3uS0oNI_lX_FQjwi1Ok.En3_eK1PB64hSfR_nW2Pl914WYl_1526kJ_f7JKAFcEHNat7s6
64s8CxkVwhOJqvjxVRzZ5QFw9rjJxqVK2bhuW88cH3EOiBS4OpqB8qplKYmhRWK4XDAKnB2mcq1x
mVZyTUAG6wG4KR5yvcK07FCTDsgvkuof0FNWCuLVgMD0.cvRNaMFSbNvGoR4W6LKdW.IpUsfl30s
toIFpCKrTp3UngO0vOZnGT08UvLPgWzCymWRhBakm5mLHoB.m6.cjGMPZq9a1cs2NTfaLhLC3BUI
fTXQ.wdciVV2_2Z2eaITMQPek_j8eU97DCFqcge.aqhdHB_ZAMMMyo_LBl.GWW6LB0XqEtv8LvzM
7u3tsP_k5sg9k.W6jUpsCWsXM8yUyoNDOSIcF9e1hRQFIex.UBTtNqJldg9VsIZN9kkbL2FCQALD
eYzPH1xX_l34yjJN_S75byNaotJfA8_n_Qz5aMFcdImhLaaVhvLZtHQPlxgUkNpPpVkXhfK_J6CC
qHgveKTkD8eaUkX0flmiMK3at8Ar2isH.Lyhl79e8dLr2qH7ShbTIN0DbUzqiqQG9bezbSxduSIe
rZQsil5Q0.aRXH4hWDPxsTypcVZVi5au3wgi1ZlWOOsT.LBP2wQHON5OPTp.xg1R76yKvt4Kixtf
OCa_k6IBI0RIzKRmKDqLthMdjaEwwWMOuFBJfD1yXjUuPNyZXgpHzVHU4aYTDBCqWUXGdilCFr34
9QB6cxlLXGus7G2QYNzzBJOKKHmMgJMR9rca1aVji5E0Oc4GfMbhF_kcWBRUQF8KuSv7GXUFdB0E
WQNaIfmvRaN9h2OVqavqrS__8Cy2zMqcZAahAVthBKOUT9ZNNpuUH7679KnBGel_fbwXVpZYo3BE
uAdTi04syZHh5j0oRaFWw3wqxa00N86SIcLDrSNOAicRP5rT8UNAnZMcMymchM_.724TGK7d2vD0
RkMoZpZSIxBgqs.iPuQBdlu9FW7mujUFcxd5i.GaFH4jtSwlvR8VWFUHriczkGIxP1U36B4fhbOt
AYXqsmLI2njMzbGP_S6FAUihFAPFDioCcQFKifSsxt4iAdPvsa9rmVBRm9ByVOQWBmets2rQGNXx
jyzVWvtNIhektKRHfhDpAcWot91tl0a4QFf38mrd5tlo1Uz06bORVRVAdIN1aXm4g.aHPU4JGx4k
sNuslT5zC3qNixA--
X-Sonic-MF: <avigross@verizon.net>
In-Reply-To: <5761dd65-4e87-8b8c-1400-edb8212048db@vub.be>
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQKk4BrivA+qeRYu5Hy/5CG+fHUyRgHQbedmAXajPfgBg8Lf7QK07BpZAuTejC0CCGGmIgGntibLARtch00BAzFXUADAJqJuApRaZ6wB6n6GJQGRF4XkqZGLjaA=
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <007b01d7c9ba$417f97e0$c47ec7a0$@verizon.net>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<86sfwqhnai.fsf@williamsburg.bawden.org>
<00b101d7c931$573d61e0$05b825a0$@verizon.net>
<5761dd65-4e87-8b8c-1400-edb8212048db@vub.be>
 by: Avi Gross - Mon, 25 Oct 2021 16:06 UTC

Antoon,

Just to be clear. I am talking about a different measure of efficiency. If
you have code that handles a limited functionality properly it can be quite
simple. If you then expand the code to handle ever more situations, then it
may do things like a series of IF statements to determine which of many
things to do so it now takes a while to just reach the part that does the
most common case. I have seen people use code that knows what arguments to
expect and just does things simply, like adding two integers together. Then
the code is improved so it detects if either argument is floating point and
now does any needed conversions. Soon you add support for complex numbers or
character strings that look like "23" and then even parse "twelve dollars
and forty two cents" in English and then a few other languages. Next you
accept range objects and other things that make sense to add and accept an
undefined number of arguments and name the darn thing sum_everything() and
proudly show it off. It now has an amazing number of errors it can propagate
or warn about. But, you can still use it to add 2 and 2.

Now, yes, nobody needs a function to just add two numbers. If that bothers
you, make is add the absolute values or something a tad more interesting.
But the point is that any code that invokes sum_everything() may now pay a
penalty in terms of performance just in the beginning part where it tests
how many arguments it got, what types they are, and so on.

The topic here is the Python run-time parser though. It is reading your code
and doing whatever complex set of things it has to do to parse from a fairly
large set of possible valid programs as well as invalid ones. I have never
looked deeply at how it works but my guess is that somewhere in there are
concepts like:

simple_asignment_expression can look like THIS.
complex _assignment expression can look like simple_assignment_expression OR
THAT OR ...

So to parse code you often need to look at alternate ways of connecting
symbols and hopefully find the one and only way it has to be looked at.
Parentheses as an example have many possible meanings and you may not know
which meaning when you encounter it until you keep going and see where there
may be a matching one but ignore any within a character string. I won't go
on but the point is that the parser can jump through more hoops even in the
most usual cases when it has to look for new cases not originally designed
in.

Your argument that people using other techniques to get the functionality
they want is not really relevant as I do not deny it. My point is that the
most common ways NORMALLY used are the ones that drive the efficiency of a
system. So if adding functionality to include new cases/situations doubles
the time it takes to do the most common case and that is used 98% of the
time, then how much overall gain for the other 2% is needed to
counterbalance it?

I find a common pattern in software that often looks like extra layers
around a function call. There may be a function to create an object given a
character string argument like vector("integer", 1, 2, 3") or
vector("character", "a", "b") that lets you create all kinds of vectors.
Someone comes along with a bright idea to make programmers instead call
make_integer(1, 2, 3) and make_character("a", "b") and more like that. We
now have lots of new function that are just going to turn around and call
vector() with a different appropriate string as the first argument and pass
along the rest. We now have a function calling a second function. Yes, there
are many possible advantages here including ways to check if you are using
your code as intended. But there is overhead. And in a tight loop repeated
millions of times, can you blame a programmer who knows, if they just call
vector() directly, or perhaps a deeper function that vector() calls when it
knows it is using integers?

I will end with this. If someone wants to design a new language from scratch
and with a goal of starting with as general a set of concepts as they can,
fine. Design it carefully. Build it and if it works well enough, use it. But
to ask an existing language to add features or expand existing ones is not
at all the same thing and requires much more care. In python, you can find
areas that are a bit confusing such as how multiple inheritance in objects
is done. It can require some tweaking to make your objects in ways that the
right thing is inherited from the other objects the way you want if more
than one has the same method and you can have subtle errors. Arguably the
darn thing is too general and many other languages instead decide not to
support multiple inheritance and may use other interesting ways to get
similar functionality. But although this can be a very nice feature allowing
you to design quite sophisticated sets of objects that inherit all kinds of
nifty powers from other existing objects, it can be a drag on performance if
it does a search through a big mess to find the right function to call at
run time! Sometimes it may be easier to not use multiple inheritance in some
part of your code and use a work-around to get what you want.

I am not against extending Python in the direction someone wants. I am FOR
careful examination and study before making the change and weighing whether
this is likely to be more useful than other things being asked for and other
relative costs. Many things turn out not to be needed. I recall programs
designed to use every letter of the alphabet (and other symbols) whether
needed or not. I mean things like "d" for delete and "a" for add and "t" for
transpose. Just to be complete, make up something that "q" or "z" do. Why?
Not because anyone wants or needs those. I have seen projects like that then
take longer to create and harder to test and the users mostly thought it was
too complex and rarely or never used some functionality. I have made macros
that allow something in an emacs editor like transpose-letter and
transpose-word and continued with sentences, paragraphs, chapters and
something beyond like transpose-on-paste-buffers. But most people actually
just do a cut and move and paste operation for the more complex scenarios
even if they remember the fancy version exists and is bound to some
forgotten series of keys clicked together like control-X control-alt-t or
something.

-----Original Message-----
From: Python-list <python-list-bounces+avigross=verizon.net@python.org> On
Behalf Of Antoon Pardon
Sent: Monday, October 25, 2021 5:21 AM
To: python-list@python.org
Subject: Re: New assignmens ...

On 25/10/2021 01:46, Avi Gross via Python-list wrote:
> No, many things need not be as general as possible once you consider
> how much work it may take to develop code and how many bugs and
> oddities might be introduced and even how much it may slow the
interpreter.
....
> I imagine you can create some fairly complex examples you can suggest
> should be handled for generality including some very indirect
> references created dynamically. The code to recognize any abstract use
> of symbols may not only slow down every operation of even the simplest
> type but generate all kinds of error messages nobody will understand,
> let alone translate into other languages properly! Right now, it is
> simpler. An error message can say that only certain simple usages are
allowed.

I don't consider this a strong argument. Limiting the scope of the walrus
operator will just force people organizing there code where they will use a
normal assignment.
So the resulting code will not be faster, less complex or generate less
error messages because the complexity of the assignment that is needed is
still the same.

Or you force people to be "creative" as follows:

Suppose I would like to write a loop as follows:

while ((a, b) := next_couple(a, b))[1]:
do needed calculations

What I can do is write it as follows:

while [tmp := next_couple(a,b), a := tmp[0], b := tmp[1]][-1]:
do needed calculations

I really don't see what is gained by "forcing" me to right the second code
over the first.

--
Antoon Pardon

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

Re: New assignmens ...

<functions-20211025175417@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram...@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: 25 Oct 2021 16:57:19 GMT
Organization: Stefan Ram
Lines: 13
Expires: 1 Dec 2021 11:59:58 GMT
Message-ID: <functions-20211025175417@ram.dialup.fu-berlin.de>
References: <skuu31$175k$1@gioia.aioe.org> <assignment-expression-20211022191403@ram.dialup.fu-berlin.de> <slrnsn63dl.503.jon+usenet@raven.unequivocal.eu> <CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com> <mailman.9.1634931312.23718.python-list@python.org> <skvnes$17je$1@gioia.aioe.org> <CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com> <mailman.12.1634953328.23718.python-list@python.org> <slrnsn84ac.503.jon+usenet@raven.unequivocal.eu> <CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com> <mailman.18.1635015339.23718.python-list@python.org> <86sfwqhnai.fsf@williamsburg.bawden.org> <00b101d7c931$573d61e0$05b825a0$@verizon.net> <5761dd65-4e87-8b8c-1400-edb8212048db@vub.be> <007b01d7c9ba$417f97e0$c47ec7a0$@verizon.net> <mailman.33.1635177990.23718.python-list@python.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de hemxoQhQN0VomN381+tSJAPIZDSDuzv63ekyExwwj5O2G1
X-Copyright: (C) Copyright 2021 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE, en-US, it, fr-FR
 by: Stefan Ram - Mon, 25 Oct 2021 16:57 UTC

"Avi Gross" <avigross@verizon.net> writes:
>Now, yes, nobody needs a function to just add two numbers.

If one uses a framework like "functools.reduce", the only
way to reduce an iterable to its sum, is to do just that:
Write a function to add two numbers.

Of course, one can circumvent "functools.reduce" (or use
"operator.add"), but in other cases there are frameworks
that need to be used and where one sometimes does need to
write functions (callbacks) as simple as "lambda: None".

Re: New assignmens ...

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

  copy mid

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

  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: New assignmens ...
Date: Tue, 26 Oct 2021 04:05:56 +1100
Lines: 27
Message-ID: <mailman.36.1635181568.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<86sfwqhnai.fsf@williamsburg.bawden.org>
<00b101d7c931$573d61e0$05b825a0$@verizon.net>
<5761dd65-4e87-8b8c-1400-edb8212048db@vub.be>
<007b01d7c9ba$417f97e0$c47ec7a0$@verizon.net>
<CAPTjJmrC_QEms+TRNhbGotHuRPrOUgSJz=2defq6kPAFhK0=AQ@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de 8oWmmhG1EwJayLov7UX4egCmEhSCR8SjZGS/Hb4L69NA==
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=TF8VRxxs;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.004
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'this:': 0.03; '26,': 0.07;
'lets': 0.07; 'task.': 0.07; 'can,': 0.09; 'language,': 0.09;
'meant': 0.09; 'avi': 0.16; 'chrisa': 0.16; 'domain?': 0.16;
'enough,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris
angelico': 0.16; 'gross': 0.16; 'language?': 0.16; 'purely': 0.16;
'received:209.85.221.51': 0.16; 'received:mail-
wr1-f51.google.com': 0.16; 'things,': 0.16; 'times,': 0.16;
'useless,': 0.16; 'wrote:': 0.16; 'solve': 0.19; 'tue,': 0.19;
'to:addr:python-list': 0.20; 'language': 0.21; 'languages': 0.22;
'maybe': 0.22; 'code': 0.23; 'command': 0.23; 'goal': 0.23;
'programming': 0.25; 'it,': 0.29; 'effect': 0.31; 'fine.': 0.32;
'python-list': 0.32; 'to:name:python': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; "i'll": 0.33; 'there':
0.33; 'script': 0.33; 'someone': 0.34; 'able': 0.34; 'work.':
0.34; 'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'trying': 0.35; 'from:addr:gmail.com': 0.35; 'using': 0.37;
"it's": 0.37; 'received:209.85': 0.37; 'this.': 0.37;
'received:209': 0.39; 'use': 0.39; 'wants': 0.40; 'should': 0.40;
'gain': 0.62; 'mental': 0.62; 'great': 0.63; 'well': 0.65;
'exactly': 0.68; 'decisions.': 0.69; 'within': 0.69; '2021': 0.71;
"you'll": 0.73; 'plus': 0.73; 'easy': 0.74; 'facilities,': 0.84;
'that!': 0.84; 'appreciation': 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;
bh=dXuwU5NZ/I9Orlrs5JWFKVI1QGo+jbfhPoD48Ro/1GQ=;
b=TF8VRxxsH3Yf4R0antyIuKUqoIoQC7XunCvDhVFTcoFyOEMU1LeiLEPtvNfJSSLeb1
so/vP5ZcZLQJ+4twY7Hxpd7K7BpEbVa6dYrPAWmy/2TcL26Ovgs5J5mm7btuYyxPoSPA
S+fZ1NzXDdiGa5JURJZIa+3nTkQnT1rewgJFMYhfU/mL02T1832TBVrDgRYnbVSbWK1W
mWQgrRNDk/+bYBEv/CF+BuvhrGyTlS7NvngfPDmewnwdhupg9DUnI8O5p9I8RXbFKjjQ
G6vFQ/KUS+QhSYISn5At2YhBuYfui5Pt5gHGRBO88pQMcMGNKVYGRUr+WZRB6HBcLA8+
UE/Q==
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;
bh=dXuwU5NZ/I9Orlrs5JWFKVI1QGo+jbfhPoD48Ro/1GQ=;
b=ppKGR35TPZiQ+nfK/NgHys8WZOVYm5lUAPlkCNs9A4yxx9vciyPLwTKQiydfxmXCSL
PKAOh+Gkmqu/kup0OUCyls8RwJunMl2HefprtRMDddjspHqz7IEUEI5V4AX2iCmhxM1O
N42onaOU3m7RN+WeEEbupeNYcTD+mI6aedDGH0zaCu3sd50JXk38Qw34fyC3HCKyOAPd
GuBWIi5u5lVxuSC1pgcNvZZZjRdysEgiMsjKhAuRn62EV1dWE6BIrnm5ERBZq8jM/rZz
AtMCv1uC9dXfQk3zTYaEZuSXt15fQleD+iuVZyQlOlnRWqIMNmrX0w3aQq79kfFgKksI
dhlw==
X-Gm-Message-State: AOAM533yYr5HFdTTbnO6D7nF6oV3IUjG3Y4/lZqesNty2OblxyCg0cIA
kdoY/VerM1r7FeXTHVfL3ycejGuvJmbihNSJTbUz8ZKL
X-Google-Smtp-Source: ABdhPJydmlSTulk/Lem+kC6wg0FCxq/PJLGtWu9HPYFBTrecyKyTDzOfCpIOa8TODdfe9SLl+6N+WcefulU43oDyQgs=
X-Received: by 2002:a05:6000:1b90:: with SMTP id
r16mr24482948wru.153.1635181567015;
Mon, 25 Oct 2021 10:06:07 -0700 (PDT)
In-Reply-To: <007b01d7c9ba$417f97e0$c47ec7a0$@verizon.net>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <CAPTjJmrC_QEms+TRNhbGotHuRPrOUgSJz=2defq6kPAFhK0=AQ@mail.gmail.com>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<86sfwqhnai.fsf@williamsburg.bawden.org>
<00b101d7c931$573d61e0$05b825a0$@verizon.net>
<5761dd65-4e87-8b8c-1400-edb8212048db@vub.be>
<007b01d7c9ba$417f97e0$c47ec7a0$@verizon.net>
 by: Chris Angelico - Mon, 25 Oct 2021 17:05 UTC

On Tue, Oct 26, 2021 at 3:07 AM Avi Gross via Python-list
<python-list@python.org> wrote:
> I will end with this. If someone wants to design a new language from scratch
> and with a goal of starting with as general a set of concepts as they can,
> fine. Design it carefully. Build it and if it works well enough, use it.

I'll add to this: Please do exactly that! It's a great mental
exercise. Sometimes you'll end up using it as a domain-specific
language, or maybe it'll become a sort of ersatz command interpreter,
or something; other times, you do the work of designing it purely for
the effect of trying it, and you've learned how languages work.

What you'll find is that there are extremes that are utterly and
completely useless, such as Turing tarpits (almost no language
facilities, but technically possible to write anything), or things so
generic that they are nothing more than containers ("a script in this
language is whatever code will make it happen"). In between, every
programming language has to make decisions. What are its goals? What
kinds of problems should be easy to solve in this language? Is it
meant to be general-purpose and able to do most things, or
special-purpose but extremely elegant within its domain?

And along the way, you'll gain a better appreciation for every
language you work with, plus a mental comprehension that lets you
understand WHY this language or that language is good for some task.

ChrisA

Re: New assignmens ...

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: antoon.p...@vub.be (Antoon Pardon)
Newsgroups: comp.lang.python
Subject: Re: New assignmens ...
Date: Mon, 25 Oct 2021 20:33:42 +0200
Lines: 53
Message-ID: <mailman.38.1635186834.23718.python-list@python.org>
References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<86sfwqhnai.fsf@williamsburg.bawden.org>
<00b101d7c931$573d61e0$05b825a0$@verizon.net>
<5761dd65-4e87-8b8c-1400-edb8212048db@vub.be>
<007b01d7c9ba$417f97e0$c47ec7a0$@verizon.net>
<465d7e85-a6a0-bb24-7148-93019536c355@vub.be>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de PNXFIdYKASGhzCqunz3ibgktvkPnVzszISyoUx+CQ1CA==
Return-Path: <antoon.pardon@vub.be>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="1024-bit key; unprotected key"
header.d=vub.be header.i=@vub.be header.b=ZNRiKZVL; dkim-adsp=pass;
dkim-atps=neutral
X-Spam-Status: OK 0.014
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'fairly': 0.05;
'hopefully': 0.07; 'matching': 0.07; 'programmer': 0.07;
'expression': 0.09; 'forced': 0.09; 'originally': 0.09; 'parse':
0.09; 'though.': 0.09; 'antoon': 0.16; 'anyway.': 0.16; 'avi':
0.16; 'encounter': 0.16; 'from:addr:antoon.pardon': 0.16;
'from:addr:vub.be': 0.16; 'from:name:antoon pardon': 0.16;
'gross': 0.16; 'message-id:@vub.be': 0.16; 'ones.': 0.16;
'pardon.': 0.16; 'reuse': 0.16; 'run-time': 0.16; 'schreef': 0.16;
'python': 0.16; 'instead': 0.17; "can't": 0.17; 'reduce': 0.19;
'to:addr:python-list': 0.20; 'code': 0.23; 'header:User-Agent:1':
0.30; 'present': 0.30; 'code,': 0.31; 'looked': 0.31; 'putting':
0.31; 'guess': 0.32; 'but': 0.32; 'there': 0.33; 'able': 0.34;
'same': 0.34; 'header:In-Reply-To:1': 0.34; 'complex': 0.35;
'invalid': 0.35; 'meaning': 0.35; 'usual': 0.35; 'cases': 0.36;
'really': 0.37; "it's": 0.37; 'this.': 0.37; 'way': 0.38; 'valid':
0.39; 'here': 0.62; 'about.': 0.64; 'in.': 0.64; 'increasing':
0.64; 'your': 0.64; 'look': 0.65; 'well': 0.65; 'clear.': 0.69;
'complexity': 0.69; 'deeply': 0.69; 'machinery': 0.69; 'within':
0.69; 'ignore': 0.71; 'handles': 0.76; 'limits': 0.76; 'yes':
0.76; 'var': 0.81; 'extra': 0.84; 'efficiency.': 0.84; 'indexes':
0.84; 'received:eurprd01.prod.exchangelabs.com': 0.84; 'reducing':
0.84
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=P5ZBnNEeDWh2MyLmIGDR3VDm9irhaemOuw0tE3KLL+NxVsGh802820/ua/zRk5GPjLwBOivRnXjGGv+vDjjyNN4j1Wzqk6KzM+Hq7P9uka90hwfvQ2DFPww0REmXcjI/doMmk2yVNfnOLaavgUdmCs8+B8ImBrWLQoPBAh1GOdRnp6o9KiTuZi07ubqfrttvF5VahbCQSpuW2pCf5Jbe+mfFchTZZpVx4ps+igNnVXGYmmc9H8sBY58rKLQ4jaiIepPmTsyQfOQReaZXh7evyAsPQcP8XdrNsSUIHPLYH5dTOfo/3HvIFP5Szk9fDHTB5tt4YVWHPRJcdx8zVTr+rQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=vz3D/Tj6G2/RMB5tRoEMGlaE6VSgUwSPWMtJMPCKmtk=;
b=ME9tSm6HKqqL166pHsc4AooDx/bg6AYmoBMgyUBoJtVImDVLf4DhVCmemotrzqigih81+uULXMPi2CzSwZ0uJb/HMSkQngyL1jkJnrYK1hGWesHm0gH1ZMq3tQfuG7DWlgQ3ivX0BjRgjXkmS8CFXmZhwu3p18KXJlSKEbf2eK4Qas3S82U9q6/dKM8xuLwBZpihkB3ZQIxo6xG/vUcjNSREY9KuqjMIddLkAthfPqKhapcaIwKY7K6arNJdpOsgui5lJViUdwYPTcGlmrZ8H6d7qDMPJYB9w1HEMFcSUS1Wwb9pSZdBK7JOLtgitU0l60V1+3Lfvh3Cc27gNKDoBQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=vub.be; dmarc=pass action=none header.from=vub.be; dkim=pass
header.d=vub.be; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vub.be; s=selector1;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=vz3D/Tj6G2/RMB5tRoEMGlaE6VSgUwSPWMtJMPCKmtk=;
b=ZNRiKZVLLRRFhLC21oQ603sgln8noRnz7Ke/HGRc5GLCCoelDdtMSPSFlRYeMnsYZMEUyD8hRHf9D0TiQGiuuD1FBDvzvlY99KU4W4Q9Zvd0a8+1LNbqnX5XWwupwnIBQeM07l2UuBol1RTRAdrpVtZVo/k6YEJXy4lcONqdCT4=
Authentication-Results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=vub.be;
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
In-Reply-To: <007b01d7c9ba$417f97e0$c47ec7a0$@verizon.net>
Content-Language: nl-BE
X-ClientProxiedBy: AM3PR07CA0078.eurprd07.prod.outlook.com
(2603:10a6:207:6::12) To AM0PR01MB4147.eurprd01.prod.exchangelabs.com
(2603:10a6:208:6a::12)
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 99c4db47-2280-4d09-b4b1-08d997e5fe48
X-MS-TrafficTypeDiagnostic: AM0PR0102MB3540:
X-Microsoft-Antispam-PRVS: <AM0PR0102MB3540023C4691B694FC2DC19D8F839@AM0PR0102MB3540.eurprd01.prod.exchangelabs.com>
X-MS-Oob-TLC-OOBClassifiers: OLM:9508;
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: riv8cd7dvn4ZuTTkZo/4jKEIeuSfp5Ln4b+CguJzjJ7W1IQmT+VkKp90r76p2H8ofrY4N84vlHoR3kMGD/6O2qOyi+aQSqJYJZgsqdVzXVil4R2zGlymbs6vTa+6aCkA/kQo0VSFCAF01c5i5/heYl2VgJNb4gn6gCFAWswNJ4cK6TOK8RR5D0eCXJx7kP7oKD238Gn/8TQ2dl+JeGvdond4NbVd5/aEaJ+vTocZJk4HZd98UGfhXRMHoxiOvhUb8x4SnAP2tVRNtISwisBYhCYJtnF5GE7EH28gx+McLvVX3DYLDTsGpkUu4UYneHPOvRDTRQVu/luvMIQoWE/nrDKkh0rIntVsiZ3U+ni4j+tDavYY4wq1rhOSnyOkzcCgrvougCIc5jKR/pXR/HN03KVCB5jBrXFbM8U54WnBT5hMCVjQvWt1r0HIPl8XHC6fL6/ezau+S/Cha+1cAn/XlcFTSzqCr49nLENX7w2Ou00qPplvhllXxJjtNLPsyiuytMV5Qf/AybG3f/TXl08NqWZwzOsKDhnIEZx8AyRxmkhR/k+6j0Ndir04moe0UXxsdJpvn9aYhZSfRVbot/Lg+6jpK2o4ZuVGwMC6fQ7YIkXyQsZsi9ChjTDFRkhw5ahOImI+smn0KL4MLR9N8KTXaWUDpxGL+7e2lKyByTM83YI9ohRN+WRipWRckda4PCW2r7OavpOdZ6WknuHxRoXMnXyp4bRCdF830nRgICumKCc=
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:AM0PR01MB4147.eurprd01.prod.exchangelabs.com; PTR:;
CAT:NONE;
SFS:(4636009)(366004)(2616005)(36756003)(5660300002)(3480700007)(52116002)(38100700002)(316002)(6666004)(31686004)(186003)(33964004)(786003)(8676002)(6486002)(7116003)(2906002)(44832011)(8936002)(66476007)(66556008)(508600001)(83380400001)(31696002)(66946007)(86362001)(6916009)(45980500001)(43740500002);
DIR:OUT; SFP:1101;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: 1ohEz1DMFYaa/cHVdX5f79RMi2lnMOjT2l9tOjlZYCb4h
fypy/nQZKGMLu4yQZ57mjcu+WMOak+ym7tUUsB89uNdMW
Wp55LrOE7TmHC7jnxLQoAVicF9sAwOttuWGYNsPEFPuoc
CsoV1ZQrN+eJLD7AbBDo3ODkxXmDW9/GDZJmKKLzba+4K
Azj3zmIn7gNC0xzvfAVBCtiaUkh+4dVWCH4ukZiQAZAHl
GVjxZ9X29hwF7j04efoHo3NkpM8fq//9g2JkWnu6/Qe6S
X/jQFf2v7H1IJMZo6KWjvNrvihloVDRZb0SE0vl7Wdugs
lXDM9U2PQ5pMWywNbh0kr9cBVbU6rpTZlqowczS+mOKb8
4pB56WmWE7nrifHhquCZCSQVMTmAK/Pmo7TtehlU9lftz
6Tq0KchQAXIVag71oiu/X05KYe72tp0iSpRVVFEzbWqYX
Lp36UQXe4evqkIDhpCD5ox35YDMkUH6wuUqXUTwiW8jBZ
E7BxSvvXDYhaD6E6NHXR4LusigMMgpC9l80uRClbtZvv1
ufyT6Zi5otJBHd7AKJB0QRdDp/tyjinNHQD5bkKUegvqV
/AD7sktmcPiA94cIn+RadBd7eqhWeAGONcLAnuMls0lyp
yenPNiNYdxjectTkTkZ8y28OiVUvAieWy9pEtOa4dD6+M
+UxOPb+Z6Gio2NdHFgi5l6pKiaao2aUt+BVW40FR3yAuO
ywZFDGA/SWtovy4fGt90aqN2lREjxLDIYkwy6Im8+bK4I
v32lCyaY8Xt6F06V1WuNHVMn0UFUmXOqZjdJlvMYRNXsu
2f7E9gRCs3vYkYg+PDUgkeWxEsfJUonXNzyGVJ0nhpTa5
OVmMniPfxzztu9J6Z6B9aT52/qIngreU7eR2estAD/ec9
kDZeTVLBbNubydfHZ4zOsex0iYwZhF01BvMdgqOxmprlA
E34khehl1jeLIfUVumfxBxNfu486BC42npr8R9D5A8krU
6dTR/QwQey6givBmzbKHgf5vsCWmQcD1Q8VClQAIa4jAC
AkZjIzvoBHzMxhDEaCvzj9v79kAp7uzAYN2eLs1gFz7Q9
9qFI4hYlA2WTg9Y/VCEGHAnbBjwIkZ4vtEALsdVeU5l5C
K9ODyY+pPDNfs0dSFNqWy2lTtdLexyDqQigwxg28wFQF9
xO/KlOJdirvh9jFGJ/sKEbfzHyOWPRvI3ttY4IXOr1y8F
2SddkBgA8Q//v7K8i8vRlh1cSyMTq1CpG+CnX1+1aYt7m
39rclHvOMweja1J56teckdfd/8yYJCidtiOFzO0Yokcqn
DwGSrbvzKCorvBICWdgbu8JiP/Kjd/aAqxqDlZW2K4/x0
dHjPqx6vERL870VQwXl/WfnYEmAG5j3mlrUtk94qSLIno
8m7lKLEtjFk9l1GwUlbmDmW/7QXKDILrNVP7CJyRoN82+
vn5Y8vyxlefYn4A6IVDHtBa/8fOKoU+g8q5ri2lYWdock
92bHhv3/iKCU4pDoDHH/u4XaXCjGvDOt2xGjqKRzg7KLC
ojT8mLzCebwA3msjo171qm1FdY035vBLd/Hi1Mb16q9ip
SjlJ2qHjyKHDITCC3P5/NYv7y0Ub3Pa02znSZH+3po94G
CiNZSEzDub9ZVgm3LQ3/r7b3lJNzRi+5u1z+u4rxbCXQD
d8+kxIaPbOGAkSDTxmz69dXAChr9WKlseqy0xhe4yQ=
X-OriginatorOrg: vub.be
X-MS-Exchange-CrossTenant-Network-Message-Id: 99c4db47-2280-4d09-b4b1-08d997e5fe48
X-MS-Exchange-CrossTenant-AuthSource: AM0PR01MB4147.eurprd01.prod.exchangelabs.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2021 18:33:52.0257 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 695b7ca8-2da8-4545-a2da-42d03784e585
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: 6KAktXRgnHAjXb820G67Zo+SrhmwnVe5DLsdB4AKz1AX7FlLbaEifNP8Y1UP/qraiV7xnKYW8kKw7aJu+NpVKw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0102MB3540
X-Content-Filtered-By: Mailman/MimeDel 2.1.35
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <465d7e85-a6a0-bb24-7148-93019536c355@vub.be>
X-Mailman-Original-References: <skuu31$175k$1@gioia.aioe.org>
<assignment-expression-20211022191403@ram.dialup.fu-berlin.de>
<slrnsn63dl.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmo5xTMdRYvRMyMHHCWCyHVTQu0LNeRJnGushopEhsBtFA@mail.gmail.com>
<mailman.9.1634931312.23718.python-list@python.org>
<skvnes$17je$1@gioia.aioe.org>
<CAPTjJmqKRHrFBjRkO8SkCh-gCTrt1sgvVjJ83tik-BzOhfiu2g@mail.gmail.com>
<mailman.12.1634953328.23718.python-list@python.org>
<slrnsn84ac.503.jon+usenet@raven.unequivocal.eu>
<CAPTjJmp+nNdsZyc3HgW2YgzaLZpSy_=LGohVp+kHEvtpJqfNGA@mail.gmail.com>
<mailman.18.1635015339.23718.python-list@python.org>
<86sfwqhnai.fsf@williamsburg.bawden.org>
<00b101d7c931$573d61e0$05b825a0$@verizon.net>
<5761dd65-4e87-8b8c-1400-edb8212048db@vub.be>
<007b01d7c9ba$417f97e0$c47ec7a0$@verizon.net>
 by: Antoon Pardon - Mon, 25 Oct 2021 18:33 UTC

Op 25/10/2021 om 18:06 schreef Avi Gross via Python-list:
> Antoon,
>
> Just to be clear. I am talking about a different measure of efficiency.

No you are not.

>
> The topic here is the Python run-time parser though.

Yes and that is what I am talking about.

> It is reading your code
> and doing whatever complex set of things it has to do to parse from a fairly
> large set of possible valid programs as well as invalid ones. I have never
> looked deeply at how it works but my guess is that somewhere in there are
> concepts like:
>
> simple_asignment_expression can look like THIS.
> complex _assignment expression can look like simple_assignment_expression OR
> THAT OR ...
>
> So to parse code you often need to look at alternate ways of connecting
> symbols and hopefully find the one and only way it has to be looked at.
> Parentheses as an example have many possible meanings and you may not know
> which meaning when you encounter it until you keep going and see where there
> may be a matching one but ignore any within a character string. I won't go
> on but the point is that the parser can jump through more hoops even in the
> most usual cases when it has to look for new cases not originally designed
> in.

IMO that extra complexity is insignificant. You really don't reduce the complexity of your
parser much if you would limit it so that indexes can only be names so that the programmer
instead of being able to write:

var = tab[some expression]

is forced to write it as:

index = some expression
var = tab[index]

Because all that machinery to evaluate some expression needs to be there anyway.

In the same way we have already all the machinery present for assignments.

By putting limits on the walrus code, you are not reducing complexity, you are increasing it.
You are increasing complexity because you can't just reuse the code that handles an ordinary
assignment. You now need specific code to limit it's use.

--
Antoon Pardon.

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor