Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Besides, I think Slackware sounds better than 'Microsoft,' don't you? -- Patrick Volkerding


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

SubjectAuthor
o Re: xor operatorMRAB

1
Re: xor operator

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: pyt...@mrabarnett.plus.com (MRAB)
Newsgroups: comp.lang.python
Subject: Re: xor operator
Date: Mon, 13 Nov 2023 21:25:42 +0000
Lines: 21
Message-ID: <mailman.222.1699910931.3828.python-list@python.org>
References: <44FBD8A8-E092-40FF-BD56-467E6936AAE9@gmail.com>
<E04D5B2F-68AF-41C1-A160-A65BFA44202F@barrys-emacs.org>
<b457ff2f-4056-406e-abae-640dc9937f44@mrabarnett.plus.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de lBZWXpWZAri7WxGddf80uwcIfMQvMtCPdCoXiWFBPC7w==
Cancel-Lock: sha1:V28A0ICQTi4t9UvlOvk8LAnuF7c= sha256:rhC8ohnM/IbkCMY4hwLH0Isz7qLX3AhEGaBi9TYrHk0=
Return-Path: <python@mrabarnett.plus.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=plus.com header.i=@plus.com header.b=iUe56v02;
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.018
X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'from:addr:python': 0.09;
'general,': 0.09; 'items.': 0.09; 'received:192.168.1.64': 0.09;
'barry': 0.16; 'false.': 0.16; 'from:addr:mrabarnett.plus.com':
0.16; 'from:name:mrab': 0.16; 'items,': 0.16; 'message-
id:@mrabarnett.plus.com': 0.16; 'received:plus.net': 0.16;
'whatever.': 0.16; 'when:': 0.16; 'wrote:': 0.16; 'values': 0.17;
'to:addr:python-list': 0.20; 'header:User-Agent:1': 0.30; 'think':
0.32; 'false,': 0.32; 'python-list': 0.32; 'received:192.168.1':
0.32; 'header:In-Reply-To:1': 0.34; 'item': 0.35; "it's": 0.37;
'received:192.168': 0.37; 'finding': 0.39; 'explain': 0.40;
'wants': 0.40; 'something': 0.40; 'want': 0.40; 'received:212':
0.62; 'true': 0.63; 'share': 0.63; 'clear': 0.64; 'items': 0.68;
'finds': 0.76; 'dom': 0.84
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=plus.com; s=042019;
t=1699910743; bh=bMDdzua9kOitNUEtfWY8kh8Qh4IWykbRD7ar3K0MtYs=;
h=Date:Subject:To:References:From:In-Reply-To;
b=iUe56v021InXQLCjj3cD0RnX2eX4ShsHrU3+pB3WNSa1vQB3X9Y2XQn9H1u4EbClK
yYRe7GkLemseKnBh9XkslNDYI4mheqA12tS6bQGlLWk7ddkwBFzrMYWqWlPtrBQBNn
lG3SCJA62P/1apubnnuAXRXxyOPwH/V+JS+3ghQ1iNwoc/Ctoqwev8Qz3m13HUWmMv
WJ//112Fa6tIWbS16GBh804lRuBVrXi/NH2MFXR9pnnkmERtkcdoZ6KNnC5kXWOHID
JEyViAjuYMbSmfKJPiiqOny3DmnIFqYJL6+qj+JBUaPZ7kerONwhYMMj4w6vH0H3vC
WO93v1UqrZKYA==
X-Clacks-Overhead: "GNU Terry Pratchett"
X-CM-Score: 0.00
X-CNFS-Analysis: v=2.4 cv=Qel1A+Xv c=1 sm=1 tr=0 ts=65529457
a=0nF1XD0wxitMEM03M9B4ZQ==:117 a=0nF1XD0wxitMEM03M9B4ZQ==:17
a=IkcTkHD0fZMA:10 a=pGLkceISAAAA:8 a=JP7nA_5DSkedxvTCgpYA:9 a=QEXdDO2ut3YA:10
X-AUTH: mrabarnett@:2500
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <E04D5B2F-68AF-41C1-A160-A65BFA44202F@barrys-emacs.org>
X-CMAE-Envelope: MS4xfPC1uH6WLabuoxGXIDfmhFH2RSL7vKlNwSXE0PMe0jBp+JGjGjDI9Bvk4vkWs2GktVoRJuXJFLzmu91Iar3Y2Pc4XF4PjbVzPgaiv4sILjxh17AsQ7Ct
yfnAqT/JUxGM+aqybMKojBZXm9Pwd+n5EgN/dUgxk86fQS4BTe9W02un9H2R8k5JjEgs1h1ScLZ7pJ8S7iArx4o3bkguYGSg2Q0=
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: <b457ff2f-4056-406e-abae-640dc9937f44@mrabarnett.plus.com>
X-Mailman-Original-References: <44FBD8A8-E092-40FF-BD56-467E6936AAE9@gmail.com>
<E04D5B2F-68AF-41C1-A160-A65BFA44202F@barrys-emacs.org>
 by: MRAB - Mon, 13 Nov 2023 21:25 UTC

On 2023-11-13 21:03, Barry via Python-list wrote:
>
>
>> On 13 Nov 2023, at 17:48, Dom Grigonis <dom.grigonis@gmail.com> wrote:
>>
>> Short circuiting happens, when:
>> xor([True, True, False, False], n=1)
>> At index 1 it is clear that the answer is false.
>
> Can you share an example with 4 values that is true?
> And explain why it is xor.
>
I think what the OP wants is something that stops after finding n true
items.

It's a more general form of what 'any' and 'all' do - 'any' stops when
it finds 1 true item and 'all' stops when it finds 1 false item.

In general, you might want to stop when you find n true items or n false
items, or whatever.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor