Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Invest in physics -- own a piece of Dirac!


devel / comp.lang.python / Re: =- and -= snag

SubjectAuthor
o Re: =- and -= snagThomas Passin

1
Re: =- and -= snag

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

  copy mid

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

  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: lis...@tompassin.net (Thomas Passin)
Newsgroups: comp.lang.python
Subject: Re: =- and -= snag
Date: Mon, 13 Mar 2023 22:23:38 -0400
Lines: 37
Message-ID: <mailman.2298.1678760624.20444.python-list@python.org>
References: <CAEtLV=oHw_VEWd2WEqtD2Xv+Yp0WYeOh_3YgNvfG8ZW69UmXqg@mail.gmail.com>
<7bc3eb74-622f-392f-b400-5e99cc7b0d29@digipen.edu>
<CAPTjJmrmECUJy-tMMhNumENjM9Q3stdaf3RMD0=9G2dpwN0CGg@mail.gmail.com>
<5f79b38c-f426-94b9-6998-490367e1223d@tompassin.net>
<CAPTjJmqSVi34iNVFS1EdE6J52y2vr6sc1wpw2F537aE5_r72bw@mail.gmail.com>
<81191265-466b-1152-93f9-d4ea24794843@tompassin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de Z7ZWOWy3OVadnOGrjpyjgAUigeRFQK+JIL7KiptWH6YQ==
Return-Path: <list1@tompassin.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=tompassin.net header.i=@tompassin.net header.b=nXlpACYX;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.033
X-Spam-Evidence: '*H*': 0.93; '*S*': 0.00; 'thread': 0.05; '2023':
0.07; 'happened': 0.07; 'mar': 0.07; 'programmer': 0.07; 'tests':
0.07; 'angelico': 0.09; 'behaviour': 0.16; 'chrisa': 0.16;
'clues': 0.16; 'dated': 0.16; 'odd': 0.16; 'received:10.0.0':
0.16; 'received:64.90': 0.16; 'received:64.90.62': 0.16;
'received:64.90.62.162': 0.16; 'received:dreamhost.com': 0.16;
'whitespace,': 0.16; 'wrote:': 0.16; 'probably': 0.17; 'pm,':
0.19; 'tue,': 0.19; 'to:addr:python-list': 0.20; 'code': 0.23;
'depends': 0.25; 'anyone': 0.25; '>>>': 0.28; 'chris': 0.28;
'wrong': 0.28; 'header:User-Agent:1': 0.30; 'putting': 0.31;
'received:10.0': 0.32; 'received:mailchannels.net': 0.32;
'received:relay.mailchannels.net': 0.32; 'but': 0.32;
'particular': 0.33; 'header:In-Reply-To:1': 0.34; 'book': 0.35;
'one.': 0.35; 'people': 0.36; 'using': 0.37; 'quite': 0.39;
'adding': 0.39; 'use': 0.39; 'wrote': 0.39; 'still': 0.40;
'exact': 0.40; 'potential': 0.60; 'including': 0.60; 'likely':
0.61; "there's": 0.61; 'great': 0.63; 'overall': 0.64; 'picked':
0.64; 'your': 0.64; 'parts': 0.65; 'numbers': 0.67;
'header:Received:6': 0.67; 'received:64': 0.67; 'know.': 0.68;
'further': 0.69; 'discussing': 0.69; 'highlight': 0.69; 'you.':
0.71; 'unit': 0.81; 'extra': 0.84; 'merely': 0.84; 'day!': 0.85;
'brain': 0.91; 'mistakes': 0.91
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1678760619; a=rsa-sha256;
cv=none;
b=YEaqFYGrm56HWmYH7Gnd7dzzuMWiL7HuKeiquRrCto8ywyquKmEcJ/3fU3JEE3JHPH9TGl
e4Is3H+Hr33InBGfh0RzNv6q6i7rvAfVrUsydsi0sCbfqnZj/fJ8+POhmwGSlgSlVhjD/K
3k3/xN2QEaaJVtboKAYsOsisY5Ce6PB3L9oFVQ8V5QnsWIykWgg+rwyhhWFNAFEGIaNw/P
ibXbI+P/E8YR6/Bc8/xrDdwwP9scZj7TiKSM/us+taSrEwqhx97sThj0lcozjekUg2ihym
n7f/jCAEe1YQR95W/grwuxq2GbnQ6J3ds5LnxDIUU95mHIlB0Ila67mj8qvi1w==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
d=mailchannels.net; s=arc-2022; t=1678760619;
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:dkim-signature;
bh=8AhVFyGCr+WTX8zFhXp+BGl1FPb7yGgUs+0GOT05kGQ=;
b=DIn1ERyjNZ1r+z4+gKrxCFgVujgIaZUT7smQfVjVtEvvFveYkhakAsgtFJf2dN5+wxDzXg
zOBnkFdrmfDS+43m/ffa6jwCYjlspz7cwMxQtnE085DyihFVl+8juv20Spyl/2+uCJkl/i
N9guTpLZEIXi2IPSc/cmrEloGTcaZBEZwOvhgNVOzRmUkjB5gdRypAJwsyulWXlbFaF3O5
/ASYl3IWck5tXocyuE7vrlVtGAqZnUGeKi/hDMIawjM0OC/DVY4gKgwvE47NZueoMYrrmQ
rsSPTasKDQEVu8HM8Jlc0hf/r9MoykLWkJBBQxJiwZ0bVVAg3oAnz4bqgvly9g==
ARC-Authentication-Results: i=1; rspamd-7584d5cf47-dbfz5;
auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|tpassin@tompassin.net
X-MailChannels-Auth-Id: dreamhost
X-Society-Drop: 342a3dac5f0c6bd8_1678760619559_2421533818
X-MC-Loop-Signature: 1678760619559:4248250171
X-MC-Ingress-Time: 1678760619558
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net;
s=dreamhost; t=1678760619;
bh=8AhVFyGCr+WTX8zFhXp+BGl1FPb7yGgUs+0GOT05kGQ=;
h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding;
b=nXlpACYXv1eVA1V/SfiW1hMiB3r/+seQ8uRFt+tyG6vW2cwSSH1D/Nx1f99ibhXVM
osqu8KST3k8UIqf4Aiiv/QOVA5OWBh/cqdiSZFU78DV0csgDkukxOkpYq+NZeS3oxV
6sMvw9BvVtH9dld/WyHfHuOnEfdZ5pN82snKzAs4h1ulzVQ0Vfvb1hT03FXlp/S/sT
7Lj3mihx/LLbLxjDFKDaxWaAngaz1XlUwKgYtM2JJmnh3fIxEyXVdss0z8S/gdUJYw
5BzW3dSp3wNmTrjBjTz9X6TrRfGbKQttJegGpXwAy6vE9Qth+Ci24idgjZPNngDEfx
sVh5HpC9c87QA==
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.8.0
Content-Language: en-US
In-Reply-To: <CAPTjJmqSVi34iNVFS1EdE6J52y2vr6sc1wpw2F537aE5_r72bw@mail.gmail.com>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <81191265-466b-1152-93f9-d4ea24794843@tompassin.net>
X-Mailman-Original-References: <CAEtLV=oHw_VEWd2WEqtD2Xv+Yp0WYeOh_3YgNvfG8ZW69UmXqg@mail.gmail.com>
<7bc3eb74-622f-392f-b400-5e99cc7b0d29@digipen.edu>
<CAPTjJmrmECUJy-tMMhNumENjM9Q3stdaf3RMD0=9G2dpwN0CGg@mail.gmail.com>
<5f79b38c-f426-94b9-6998-490367e1223d@tompassin.net>
<CAPTjJmqSVi34iNVFS1EdE6J52y2vr6sc1wpw2F537aE5_r72bw@mail.gmail.com>
 by: Thomas Passin - Tue, 14 Mar 2023 02:23 UTC

On 3/13/2023 9:47 PM, Chris Angelico wrote:
> On Tue, 14 Mar 2023 at 12:38, Thomas Passin <list1@tompassin.net> wrote:
>>
>> On 3/13/2023 9:07 PM, Chris Angelico wrote:
>>> Of course, all this is predicated on you actually putting whitespace
>>> around your equals signs. If you write it all crunched together as
>>> "x=-5", there's no extra clues to work with.
>>>
>>> Linters and code reviewers can make use of all the available
>>> information, including whitespace, to determine programmer intent.
>>
>> This is the kind of thing that unit tests can catch.
>>
>
> Maybe, but that's quite orthogonal. The linter would highlight the
> exact line of code with the odd whitespace; a unit test would merely
> point out that the overall behaviour is incorrect, which would have
> been no further information beyond what the OP already knew (the
> numbers weren't adding up).
>
> ChrisA

*This* time the OP happened to know. People in the thread have been
discussing how to pick this kind of mistake with linters or what have
you. Even with a linter, whether or not this would have been picked up
depends on how it has been configured.

Really, the only defense against these kind of potential mistakes or
typos is not to use constructions that may be more likely to get wrong
(or be typoed). In this particular case, that would probably be too
great a limitation for most of us. But the general principle is a good
one. Douglas Crockford wrote a book on using just the better parts of
Javascript (JavaScript: The Good Parts - rather dated by now but still
worth the reading).

Of course, anyone can have a brain blip on any given day!

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor