Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

I'm not sure whether that's actually useful... -- Larry Wall in <199710011704.KAA21395@wall.org>


devel / comp.lang.python / RE: walrus with a twist :+= or ...

SubjectAuthor
o RE: walrus with a twist :+= or ...Avi Gross

1
RE: walrus with a twist :+= or ...

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: avigr...@verizon.net (Avi Gross)
Newsgroups: comp.lang.python
Subject: RE: walrus with a twist :+= or ...
Date: Wed, 27 Oct 2021 22:50:56 -0400
Lines: 118
Message-ID: <mailman.109.1635389464.23718.python-list@python.org>
References: <030e01d7cb96$b69ffc30$23dff490$.ref@verizon.net>
<030e01d7cb96$b69ffc30$23dff490$@verizon.net>
<033701d7cb97$fa593710$ef0ba530$@verizon.net>
<1432ee00-ed82-372c-6437-056133ce79b1@mrabarnett.plus.com>
<035601d7cba6$a1da7fe0$e58f7fa0$@verizon.net>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de 5LscSND3fE+vg92sY91ZmQmE35rDyBR4KmOd819IV+tg==
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=El3V0UiG;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.040
X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'argument': 0.04; '27,':
0.09; 'along,': 0.09; 'flags': 0.09; 'operators': 0.09; 'unix,':
0.09; 'url:mailman': 0.15; 'syntax': 0.15; '(outside': 0.16;
'1980': 0.16; '>>>>': 0.16; 'avi': 0.16; 'colon': 0.16;
'constantly': 0.16; 'encryption': 0.16; 'gross': 0.16;
'operators:': 0.16; 'received:(vzm hermes smtp server)': 0.16;
'sadly,': 0.16; 'specify': 0.16; 'syntaxerror:': 0.16; 'them?':
0.16; 'wrote:': 0.16; 'python': 0.16; 'october': 0.17;
'implement': 0.19; 'it?': 0.19; 'to:addr:python-list': 0.20;
'all,': 0.20; 'language': 0.21; 'maybe': 0.22; 'skip:- 10': 0.25;
'url-ip:188.166.95.178/32': 0.25; 'url-ip:188.166.95/24': 0.25;
'url:listinfo': 0.25; 'url-ip:188.166/16': 0.25; 'anyone': 0.25;
'opening': 0.26; 'wednesday,': 0.26; 'purpose': 0.28; 'whole':
0.30; 'url-ip:188/8': 0.31; '"",': 0.32; 'course.': 0.32; 'python-
list': 0.32; 'realize': 0.32; 'but': 0.32; 'there': 0.33; 'mean':
0.34; 'header:In-Reply-To:1': 0.34; 'trying': 0.35; 'fine': 0.35;
'invalid': 0.35; 'functions': 0.36; 'people': 0.36; 'using': 0.37;
'though': 0.37; 'file': 0.38; 'means': 0.38; 'valid': 0.39; 'use':
0.39; 'break': 0.39; 'decide': 0.39; 'methods': 0.39; 'seeking':
0.40; 'serious': 0.40; 'something': 0.40; 'want': 0.40;
'remember': 0.61; 'from:': 0.62; 'to:': 0.62; 'ever': 0.63;
'extend': 0.64; 're:': 0.64; 'came': 0.65; 'look': 0.65; 'shows':
0.67; 'forget': 0.67; 'acceptable': 0.69; 'and,': 0.69;
'sequence': 0.69; 'type:': 0.69; 'front': 0.70; 'them,': 0.70;
'2021': 0.71; 'candidates': 0.76; 'sent:': 0.78; 'left': 0.83;
'completeness': 0.84; 'forgot': 0.84; 'obj': 0.84; 'remind': 0.84;
'similarly': 0.84; 'spell': 0.84; 'we?': 0.84; 'vote': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=verizon.net; s=a2048;
t=1635389462; bh=kcXCaD8pepUn3yNUqGiBtAVxkMdUItYMtXFGxc50MQA=;
h=From:To:References:In-Reply-To:Subject:Date:From:Subject:Reply-To;
b=El3V0UiGafYVGHdlu4kRoa/hAKvxo35kEUEtaJKzJiiM04vP0O847zcOEEwy8IqcDjVitHV6hg61r4k38nAQudCVh/z8wF8e+6X3KFoq46zUCEi0VUzVo+vPW9Z/NY408pOSkiu2+iKjngHrns+g9Vu0J6/PoBnbdnDsgWJ+YvDs4+8QJB6gwhAPoCFa1eWeAQyrc2twwz8IsPW78p22BtDRZD1G17kcSiafugoImulu1NZI1qqMFLriidPhrEEjaBLtN1pKpr0u90z4NsXiFd7xYXzuzyRTRl4LFfmVr1GmLRV7eB73re1syWYZ/d1niCYTTdr32Di86PTjCH4Mng==
X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048;
t=1635389462; bh=HhA8uFIuuwXcLh/qbVj7IABoOKva8QRt+wTdAJjgUJn=;
h=X-Sonic-MF:From:To:Subject:Date:From:Subject;
b=K/31Z87Q47vaJLSag+ZMnG2ed7hPECr6VMXLFG2hQGXkZxEDQzzeDVRa7TQw+kB2gaNlIR2B6HTdLe3gnHnGuPSmEeOuZowuzlCZzWCf6vCsYxYvKOSQLB+ViaZkrMexjTNGqui7NukJTt8fHtt7+2tIiwIuKRJk8JxhvVaaseJFXvMBRpNHadN9jWpCoztOXUEp9eCGeWae99xWFp6iqOr2oLGWpHsrZG6FuEStf9NDsc7x/P0f4EnO0mxvIIEyt62xaPf6vMP+1lB5X7z/L/pq2vEyJWugMWGcVIEHRC/sDzT/do1P3cJyxIKZiyMsB7cmhVLNtYSxN0F1+f2C3A==
X-YMail-OSG: NOPnU10VM1ljEzPnmLFHtUoO0Udm7f07xKnIJhqSOi9fzqznutLmoAuDfX9Z0LD
a_TY06sCKpS7rYbJj52GR.Te35eghXLZEBssMa1uEWJh6laUVzpraZpmpDIK26XHOsuHnMtPT91P
ePrBSP_ZvLdvrLVRmC0GLzduGtUUFbfqFENf2L_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rabarnett.plus.com>
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQHoKDY5BYYyhDJV6IPWj6XGikF5MwFgB8FdApp6ZtsDBpLYF6uO6niw
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: <035601d7cba6$a1da7fe0$e58f7fa0$@verizon.net>
X-Mailman-Original-References: <030e01d7cb96$b69ffc30$23dff490$.ref@verizon.net>
<030e01d7cb96$b69ffc30$23dff490$@verizon.net>
<033701d7cb97$fa593710$ef0ba530$@verizon.net>
<1432ee00-ed82-372c-6437-056133ce79b1@mrabarnett.plus.com>
 by: Avi Gross - Thu, 28 Oct 2021 02:50 UTC

Correct, I left out a bit, not wisely.

I am trying to remember the last time (outside of classes) I have ever had
to use bitwise operators nontrivially and it may have been around 1980 when
I had to implement an encryption algorithm. Of course, when I was working in
UNIX, I often had to combine bitwise things to specify all kinds on 1-bit
flags when say opening a file.

So we now have so many candidates FOR COMPLETENESS to add as variants of the
Walrus operator, that I might vote to do NONE of them, if anyone ever asked.

I do want to remind people though that these operators often serve a purpose
in Python as using them means you do not need to specify an argument twice
and you can specify some dunder methods that make it more efficient to type:

obj += obj2

rather than

obj = obj + obj2

So there may be a valid argument, not just about completeness, to implement
something BUT as we got along fine before a walrus came along, ...

or did we?

-----Original Message-----
From: Python-list <python-list-bounces+avigross=verizon.net@python.org> On
Behalf Of MRAB
Sent: Wednesday, October 27, 2021 9:21 PM
To: python-list@python.org
Subject: Re: walrus with a twist :+= or ...

On 2021-10-28 02:06, Avi Gross via Python-list wrote:
> I just realized I left out **= so my apologies. Are there other such
> abbreviations and does anyone use them?
>
You forgot about the bitwise operators: |= &= ^=

> -----Original Message-----
> From: Python-list
> <python-list-bounces+avigross=verizon.net@python.org> On Behalf Of Avi
> Gross via Python-list
> Sent: Wednesday, October 27, 2021 8:57 PM
> To: python-list@python.org
> Subject: walrus with a twist :+= or ...
>
> I realized that the person seeking completeness in Python may next ask
> why the Walrus operator, :=, is not properly extended to include a
> whole assortment of allowed assignment operators
>
>
> I mean in normal python programs you are allowed to abbreviate
>
> x = x + 5
>
> with
>
> x += 5
>
> Similarly you have other operators like
>
> x *= 2
>
> And, of course, the constantly used operator:
>
> x %= 2
>
> So how does one extend a walrus operator if they ever decide to give
> in and add it to the language just for completeness?
>
> Sadly, a simple test shows they neglected to use a :+= operator in the
> latest:
>
>>>> (walrus := 2)
>
> 2
>
>>>> walrus
>
> 2
>
>>>> (wallrus :+= 2)
>
> File "<stdin>", line 1
>
> (wallrus :+= 2)
>
> ^
>
> SyntaxError: invalid syntax
>
> (Yes, I know how to spell walrus, but making a point.)
>
> On a serious note, if it was ever considered a good idea, what would
> be an acceptable sequence of symbols that might not break or confuse
> existing programs and what would we call it? I mean what animal, of
course.
>
> What do these look like in some fonts? :+= :-= :*= :/= :%=
>
> Or do we not just add a colon in front and make it a tad different as in
:=+
> or :+=: or maybe realize the futility of perfection! After all, you can
> easily use some functions to get a result such as:
>
> x := func(x, "+", 5)
>
> x := func_add(x, 5)
>
> or many other work-arounds.
>
> Can we all forget I asked? I am sort of being sarcastic.
>
--
https://mail.python.org/mailman/listinfo/python-list

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor