Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #40: not enough memory, go get system upgrade


comp / comp.lang.python / Re: A missing iterator on itertools module?

SubjectAuthor
o Re: A missing iterator on itertools module?Antoon Pardon

1
Subject: Re: A missing iterator on itertools module?
From: Antoon Pardon
Newsgroups: comp.lang.python
Date: Wed, 3 Apr 2024 09:11 UTC
References: 1 2
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: antoon.pardon@vub.be (Antoon Pardon)
Newsgroups: comp.lang.python
Subject: Re: A missing iterator on itertools module?
Date: Wed, 3 Apr 2024 11:11:01 +0200
Lines: 28
Message-ID: <mailman.60.1712135466.3468.python-list@python.org>
References: <66059eb6$0$7522$426a34cc@news.free.fr>
<a8821ec9-2388-4c33-b743-a4ed6f550b99@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 lqDyMn7iN7JA2taNcf8vTwR5fRh2ByeEt5YkEqoc8RNw==
Cancel-Lock: sha1:gbDq0LRn3UBuip+JKRWA/52iAQc= sha256:2yykcxh7+nEezFM1QEk/RFZxvcndV7Cng6v+jP6W1rA=
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=oQOeADMF; dkim-adsp=pass;
dkim-atps=neutral
X-Spam-Status: OK 0.012
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'partial': 0.07;
'subject:module': 0.07; 'ast': 0.09; "'d',": 0.16;
'from:addr:antoon.pardon': 0.16; 'from:addr:vub.be': 0.16;
'from:name:antoon pardon': 0.16; 'itertools': 0.16; 'mentions':
0.16; 'message-id:@vub.be': 0.16; 'received:40.107.21': 0.16;
'schreef': 0.16; 'solution:': 0.16; 'subject:missing': 0.16;
'to:addr:python-list': 0.20; 'anything': 0.25; 'header:User-
Agent:1': 0.30; 'but': 0.32; "didn't": 0.34; 'header:In-Reply-
To:1': 0.34; 'job.': 0.62; 'your': 0.64; 'came': 0.65; 'produce':
0.65; 'delivers': 0.76; 'received:eurprd01.prod.exchangelabs.com':
0.84; 'strings': 0.84
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=Vga418cbGfGD6u37Q5+xXgGNmSxrpOk4HOr5O2N8HyXKJsO846w4X+jyz6sPOvDI3fymfqcz77zJoNqePYgvhh68IxW4PrkSFP+aaUusxmLGEXzBfB2HGNRTGWzn7bYWwLVEDK6nsfnoIHi2RE4ru+5fU/qW9zNjGKKxkD/vGMQfZ2envEdAVKERd2DeFBe9NI4W9MYQX9VQbwBb9jGacUaxrteMk2N+SX181xt35Sn98PuDEyMyrFB/slTr0vtGnfeKH93HB55KYpca1+P60g43J3W946JUHv38hnPcsnA2sTzfitFGBzFSuFY1dqbOigb0TBm7N87EvVpvXiUY0A==
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=53fJNOIzmJddqBydjWK3pN08ZqyyNEG9UxDGxT6r67E=;
b=oKgMRfcRMHA31+FR6D3D7fvGBCraQIuR+SIntmAsfs6jRRYlJBA/fJ9ATZUnpwaooSrOAVI9j527SXnVDHjjWd1GJbpBnGngOjP2NJ7DvPIftZkza39Nwg1Au+ipzkx2Tyuwf04E2vPHDCyTplWQXeP53GB/Bi9ide0tUHfw7q7+fhUmQnpzDHQWOsM6u/1qIGPsoBruIB7ZwhBhpv2ptN34iAqBZtMg7KzOfFzOeKzc9AlSGxmlL2JnuOlD/6N7VxVgUMlDyWIb8/fNj10M/V9bDR62V8t66ffdOoLpCFvPz9LIN1OvzDdMUISyQU6Fj8l1IZXR7yLm1y1YOIsIWg==
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=53fJNOIzmJddqBydjWK3pN08ZqyyNEG9UxDGxT6r67E=;
b=oQOeADMFY2K8sHnoDK9XFblvqwGlEn3zZoKBDhJMBjhT4NcdKSeyNe59NiW9jTbr6o8q+SEDap6qMXK+oRj0HNm/yDCMYBucW1vbbl2oqjM7lUxQUtqHPVC4uau1yeVM00hRKupBECQ8RMY8oURSqgVz8ZsEw0D2SZfTU0w6Hog=
User-Agent: Mozilla Thunderbird
Content-Language: nl-BE
In-Reply-To: <66059eb6$0$7522$426a34cc@news.free.fr>
X-ClientProxiedBy: PR1P264CA0063.FRAP264.PROD.OUTLOOK.COM
(2603:10a6:102:2ca::18) To PR3PR01MB7986.eurprd01.prod.exchangelabs.com
(2603:10a6:102:171::5)
X-MS-PublicTrafficType: Email
X-MS-TrafficTypeDiagnostic: PR3PR01MB7986:EE_|DB9PR01MB9342:EE_
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: A02HXP0/CUxuAhNhyd+oMswDlLG4bZ06PGNdD/cHX8+ZdMhWDR47gmhP4lytwJdC4cPdUzQ3+kn7zgCeWCGiV5HpNc/Jz516wzCSg1kxQsK9KI2yEz4n7qx/nmFBpij50zhLWwULxn0m6ikIlrBT5A4yy1wYimvgTSiKLBPEkVCsLTTyori9syrNuWMbmthiphC2IdDPR9wbcx4BaksmHAAsEbqRcoOTYtkPvbnRoYXLrQSELjGsjzTFRSmHNLwEe9b40/HhzkzKSoDVDsWGJLVWcNwHgW3kcz8Js0BKrAzUPNDZt+5yTmGU0kX3kl/OBsBxv7x/bzU6V3zqvW50w8funPdltI3eFyJP4IwlNc8EDDq6URsgZADJTYRIg2Aa+3GkuP6oRcWaaNabTwme/bPQFOpoVuc+PTIl3KJLh9qVsjNsRSOMfcscaez5a1KY9g29ay6lLDNb7H6klXGQDnfGQBaAdAyieK8zGQdVbnH2rVGWtvAkwGv9SBhJ8TpQfDMffvDv0PqyS8n5JwGp8B6EzOIHIZ1oZqsO2v1lEqMhUwrARVyQKDGL6uhI5zJaf0juk4P1HUV4ABIlsImIBnQIcNClYaeyJu5qPrwRYYLmlJ0n3BjTD/MGfOX/zQInVguCoGKtPiCQD5vbnsJMlrMFXTUanYUPu2npvrV5AFM=
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:PR3PR01MB7986.eurprd01.prod.exchangelabs.com; PTR:;
CAT:NONE; SFS:(13230031)(366007)(376005)(1800799015); DIR:OUT; SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: mhPfjx7eyoXCdqfHXyZz8uGwYdWKAo3O5wGwXIsYzwu6h
b6erWHDnYWgET2W6KhXC4eINfmyH+KR21pHoEwme84VPA
QfoNe0GYwh3REAroMqWTz/zCOuxsIoBoyRuzwKZ8xKMzW
+O69ayGdkARaPjm8w6tR5qambJ7RB/Y/Ux4LvFMwtHzRF
mFiD93FRTalw28ESMJJdjxzOVmu0c3WoZjeqCE0iGhbJ4
qi4HFMOKkdgpFmvhOCfpsv+xWCY2Gr6OqCz94XCXGQxmj
7vhIkP8KV3eIAXNWi+Yf2W/C8Y+rET3jIq00y/UHgqrn1
JlM9Mqx3NOVOtkv05VwzM96Je4egnyJi4JlCTcrtoUU4Y
pgqRswpHKw9HBDja1IOV3LtiitPNrMVCiTvp+6YA48QN0
HknV1xYFiOI9vNt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6isBcpCzw58KHZ3klUzgMUyP
uLaJchM5xKxPaFeJF8iJlf64jlA3u6D72Gs9IaZfsM4wP
VIqdh/chSIsPQ0Elgy0ZAqTugwusqd3nWtQUwDkUaAAX/
Eud/2o9Opb5glkocx7IbWcd+o
X-OriginatorOrg: vub.be
X-MS-Exchange-CrossTenant-Network-Message-Id: 0a5b08bf-0ca9-47ee-cf97-08dc53bdfc89
X-MS-Exchange-CrossTenant-AuthSource: PR3PR01MB7986.eurprd01.prod.exchangelabs.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Apr 2024 09:11:03.2365 (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: sPBR7uFYGoGBfl6+1RgNzYvmJLOrQ06wlHtl9cXYew2S+XegWrLjhkjHk25iFtiCl7mjqAB2vCij/tn5KVjFkw==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR01MB9342
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: <a8821ec9-2388-4c33-b743-a4ed6f550b99@vub.be>
X-Mailman-Original-References: <66059eb6$0$7522$426a34cc@news.free.fr>
View all headers

Op 28/03/2024 om 17:45 schreef ast via Python-list:
> Hello
>
> Suppose I have these 3 strings:
>
> s1 = "AZERTY"
> s2 = "QSDFGH"
> s3 = "WXCVBN"
>
> and I need an itertor who delivers
>
> A Q W Z S C E D C ...
>
> I didn't found anything in itertools to do the job.

The documentation mentions a roundrobin recipe.
>
> So I came up with this solution:
>
>
> list(chain.from_iterable(zip("AZERTY", "QSDFGH", "WXCVBN")))
>
> ['A', 'Q', 'W', 'Z', 'S', 'X', 'E', 'D', 'C', 'R', 'F', 'V', 'T', 'G',
> 'B', 'Y', 'H', 'N']

But if your strings are not equal, this will only produce a partial result.

1

rocksolid light 0.9.8
clearnet tor