Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

The moving cursor writes, and having written, blinks on.


devel / comp.lang.python / Re: xor operator

SubjectAuthor
o Re: xor operatorAlan Gauld

1
Re: xor operator

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!rocksolid2!news.neodome.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: learn2pr...@gmail.com (Alan Gauld)
Newsgroups: comp.lang.python
Subject: Re: xor operator
Date: Tue, 14 Nov 2023 01:08:26 +0000
Lines: 27
Message-ID: <mailman.237.1699924110.3828.python-list@python.org>
References: <2624DD04-097A-48B1-9F05-C6EF30F4C82D@gmail.com>
<6552a859.020a0220.8cb14.012f@mx.google.com>
<78B43ECD-2EFC-4CDF-99C4-DC310F0B26DE@gmail.com>
<CAPTjJmr+AthCgZWkkehL3i=wCywGG+ShUiBcKtkhZxYdFgy+ow@mail.gmail.com>
<FCFD8802-9FE9-48E0-B453-F9C22121EDF9@gmail.com>
<2f915cf1-c8ca-4db4-87a7-4597d5209b71@wichmann.us>
<1b048d51-e0e6-1915-3593-b15f3e147f36@yahoo.co.uk>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de MWcR6YsXzUeCkfNcNn0+kw9s5etdMbPDqWj4HwRRLSuQ==
Cancel-Lock: sha1:QoePjs+SIFa8XANDK256A8AhBPU= sha256:Uuacf/HJrryc3R44ZANVDbl5psCME4BOXA/Pp9FPh80=
Return-Path: <learn2program@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=fg6R2Pbo;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.013
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'tests': 0.07; 'later,':
0.09; 'flickr': 0.16; 'from:name:alan gauld': 0.16; 'mats': 0.16;
'message-id:@yahoo.co.uk': 0.16; 'odd': 0.16; 'photo-blog': 0.16;
'received:mail-wm1-x32b.google.com': 0.16; 'somewhat': 0.16;
'studied': 0.16; 'url-ip:79.170.44.132/32': 0.16; 'url-
ip:79.170.44/24': 0.16; 'url-ip:79.170/16': 0.16; 'url-ip:79/8':
0.16; 'url:alan-g': 0.16; 'url:alan_gauld': 0.16;
'url:alangauldphotos': 0.16; 'values,': 0.16; 'wichmann': 0.16;
'wiring': 0.16; 'wrote:': 0.16; 'hardware': 0.19; 'url:amazon':
0.19; 'to:addr:python-list': 0.20; "i've": 0.22; 'views': 0.23;
'to:name:python-list@python.org': 0.24; '(and': 0.25; 'header
:User-Agent:1': 0.30; 'program': 0.31; 'context': 0.32; 'python-
list': 0.32; 'received:192.168.1': 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; 'change': 0.36;
'really': 0.37; 'author': 0.37; 'engineering': 0.37;
'received:192.168': 0.37; 'single': 0.39; 'alan': 0.40; 'case.':
0.40; 'wants': 0.40; 'learn': 0.40; 'both': 0.40; 'come': 0.62;
'follow': 0.62; 'entire': 0.67; 'url-ip:18/8': 0.67; 'url:author':
0.69; 'site': 0.70; 'life': 0.77; 'parity': 0.84; 'switching':
0.84; 'truth': 0.86; 'sides.': 0.91; 'operates': 0.93
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1699924108; x=1700528908; darn=python.org;
h=content-transfer-encoding:in-reply-to:references:to
:content-language:subject:user-agent:mime-version:date:message-id
:from:from:to:cc:subject:date:message-id:reply-to;
bh=T/mq98VindzIfCD9UfM0GAdI6yU4oTDejSaSAUgdQEE=;
b=fg6R2PboUx02JJkm/c8/CAhq2W76XtfBvKna5b2QvLNu7qSqvliGNofvl/vZ0BSRuk
ivKi5wqVB/ajiA7q1//YkXkdTkVKiLDgGEe0P+6Dtpx4mRk+3GcDOtXkxiCcAh8haOqY
aJLPuJbd9Hz+nBRfTMKFMvLl1SL5gBMM7F1NlA8Y4WD50wZ/dKUj/H456AHRdYrD20Hy
y6+JWVaHe4Trj/uvViQBQuaiv9EHT2h8X9dp88FGQPqCu0jpn3R/ek01loXzGxiAIv+F
jBy4bpqkwNZxIP7Z208O1RcnJrfK8LpfdKJrg0QROGr0JhZxHJGt2xZNniFXy976bzd5
xhwg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1699924108; x=1700528908;
h=content-transfer-encoding:in-reply-to:references:to
:content-language:subject:user-agent:mime-version:date:message-id
:from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=T/mq98VindzIfCD9UfM0GAdI6yU4oTDejSaSAUgdQEE=;
b=AdVNm6Ll3ZDmzvrlzuJxDSYcJFAImW3hIWHPsafxXi+IaOGJQCZqAgRaJMySYksTjA
1aLt64X3Rtj71+dzlvnwOxkaEQpYgpu8FOqWFBmO67suck3gzeZNzuVLF65UPpCXqjYZ
WYuRXvOncq97N0+PUI02dTEXrgBJ8i2wa919d+DH/SqZKJK3+trWtgU8OFsPl5L9ufAm
kA3R7m3DmOPWAKS2cO4YBCOmICLsNfREOYUYRDDyhAxAlsX6o19KQQjYP6IHCHmV3qa2
Zp9MC2SBV/9AjjyG/i1QVh9QzKXKD3xaJoTpha1eciGAwu7RlSWk2kHSEEkceRn0KhYl
sYqQ==
X-Gm-Message-State: AOJu0Yw/MQLSqyEFBcogvM0L+dOAinfsa3Rtfr63rR4zjpEDsPJJyAng
Qo3u87uRTbGybSvu0Me7MIIH1l6haud6oQ==
X-Google-Smtp-Source: AGHT+IHL0yiotKkBPrTschq6OcnK5Ft5wMp8t5t1ojj4FZZowpg9jGVLn1mu/u4ltaKrdzga1Y9SSg==
X-Received: by 2002:a05:600c:4f8e:b0:40a:3e41:7dd8 with SMTP id
n14-20020a05600c4f8e00b0040a3e417dd8mr6002077wmq.13.1699924107854;
Mon, 13 Nov 2023 17:08:27 -0800 (PST)
X-Google-Original-From: Alan Gauld <alan.gauld@yahoo.co.uk>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0)
Gecko/20100101 Thunderbird/102.12.0
Content-Language: en-GB
In-Reply-To: <2f915cf1-c8ca-4db4-87a7-4597d5209b71@wichmann.us>
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: <1b048d51-e0e6-1915-3593-b15f3e147f36@yahoo.co.uk>
X-Mailman-Original-References: <2624DD04-097A-48B1-9F05-C6EF30F4C82D@gmail.com>
<6552a859.020a0220.8cb14.012f@mx.google.com>
<78B43ECD-2EFC-4CDF-99C4-DC310F0B26DE@gmail.com>
<CAPTjJmr+AthCgZWkkehL3i=wCywGG+ShUiBcKtkhZxYdFgy+ow@mail.gmail.com>
<FCFD8802-9FE9-48E0-B453-F9C22121EDF9@gmail.com>
<2f915cf1-c8ca-4db4-87a7-4597d5209b71@wichmann.us>
 by: Alan Gauld - Tue, 14 Nov 2023 01:08 UTC

On 14/11/2023 00:33, Mats Wichmann via Python-list wrote:
> Hardware and software people may have somewhat different views of xor

I've come at it from both sides. I started life as a telecomms
technician and we learned about xor in the context of switching
and relays and xor was a wiring configuration for scenarios where
you wanted any single change of switch state to toggle the
entire system (think a stairwell with switches on every
landing).

Later, I got into software engineering and we studied Boolean
algebra and xor was an odd number of Truth values, used in
parity tests (and in encryption).

But from both perspectives xor is pretty clearly defined
in how it operates and not, I suspect, what the OP really
wants in this case.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor