Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Be consistent. -- Larry Wall in the perl man page


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

SubjectAuthor
* A missing iterator on itertools module?ast
+- Re: A missing iterator on itertools module?ast
+* Re: A missing iterator on itertools module?Stefan Ram
|`* Re: A missing iterator on itertools module?ast
| `* Re: A missing iterator on itertools module?Stefan Ram
|  +- Re: A missing iterator on itertools module? (Posting On Python-List Prohibited)Lawrence D'Oliveiro
|  `- Re: A missing iterator on itertools module?Mark Bourne
+- Re: A missing iterator on itertools module?Antoon Pardon
`- RE: A missing iterator on itertools module?<avi.e.gross

1
A missing iterator on itertools module?

<66059eb6$0$7522$426a34cc@news.free.fr>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed1-b.proxad.net!nnrp6-1.free.fr!not-for-mail
Date: Thu, 28 Mar 2024 17:45:42 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Newsgroups: comp.lang.python
Content-Language: fr
From: none@none.fr (ast)
Subject: A missing iterator on itertools module?
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 23
Message-ID: <66059eb6$0$7522$426a34cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 28 Mar 2024 17:45:42 CET
NNTP-Posting-Host: 91.170.32.5
X-Trace: 1711644342 news-4.free.fr 7522 91.170.32.5:14595
X-Complaints-To: abuse@proxad.net
 by: ast - Thu, 28 Mar 2024 16:45 UTC

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.

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']

Do you havbe a neat solution ?

Re: A missing iterator on itertools module?

<66059f24$0$7522$426a34cc@news.free.fr>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.nntp4.net!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed3-b.proxad.net!nnrp6-1.free.fr!not-for-mail
Date: Thu, 28 Mar 2024 17:47:32 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: A missing iterator on itertools module?
Newsgroups: comp.lang.python
References: <66059eb6$0$7522$426a34cc@news.free.fr>
Content-Language: fr
From: none@none.fr (ast)
In-Reply-To: <66059eb6$0$7522$426a34cc@news.free.fr>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 8
Message-ID: <66059f24$0$7522$426a34cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 28 Mar 2024 17:47:32 CET
NNTP-Posting-Host: 91.170.32.5
X-Trace: 1711644452 news-4.free.fr 7522 91.170.32.5:14595
X-Complaints-To: abuse@proxad.net
 by: ast - Thu, 28 Mar 2024 16:47 UTC

Le 28/03/2024 à 17:45, ast a écrit :

> A Q W Z S C E D C ...

sorry
A Q W Z S X E D C

Re: A missing iterator on itertools module?

<solution-20240328180624@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: A missing iterator on itertools module?
Date: 28 Mar 2024 17:07:25 GMT
Organization: Stefan Ram
Lines: 20
Expires: 1 Feb 2025 11:59:58 GMT
Message-ID: <solution-20240328180624@ram.dialup.fu-berlin.de>
References: <66059eb6$0$7522$426a34cc@news.free.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de d9Kl0N24pA+uEw/BL7MMHgUp8MibHsPA2VgZ0x9vVSyiCJ
Cancel-Lock: sha1:tzVirbaOKjnUsswJxBS/MOxoGxg= sha256:G2hXAHd8hzPFzc9FD5yF1lNXyTuTnCMrHZueR5wF304=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Thu, 28 Mar 2024 17:07 UTC

ast <none@none.fr> wrote or quoted:
>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.
>So I came up with this solution:
>list(chain.from_iterable(zip("AZERTY", "QSDFGH", "WXCVBN")))

Maybe you meant "zip(s1,s2,s3)" as the definition of s1, s2,
and s3 otherwise would not be required. Also the "list" is not
necessary because "chain.from_iterable" already is an iterable.
You could also use "*" instead of "list" to print it. So,

import itertools as _itertools
s =[ "AZERTY", "QSDFGH", "WXCVBN" ]
print( *_itertools.chain.from_iterable( zip( *s )))

. But these are only minor nitpicks; you have found a nice solution!

Re: A missing iterator on itertools module?

<6605a515$0$2578$426a74cc@news.free.fr>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!usenet.goja.nl.eu.org!3.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!cleanfeed2-a.proxad.net!nnrp3-2.free.fr!not-for-mail
Date: Thu, 28 Mar 2024 18:12:54 +0100
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: A missing iterator on itertools module?
Newsgroups: comp.lang.python
References: <66059eb6$0$7522$426a34cc@news.free.fr>
<solution-20240328180624@ram.dialup.fu-berlin.de>
Content-Language: fr
From: none@none.fr (ast)
In-Reply-To: <solution-20240328180624@ram.dialup.fu-berlin.de>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Lines: 23
Message-ID: <6605a515$0$2578$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 28 Mar 2024 18:12:53 CET
NNTP-Posting-Host: 91.170.32.5
X-Trace: 1711645973 news-1.free.fr 2578 91.170.32.5:6301
X-Complaints-To: abuse@proxad.net
 by: ast - Thu, 28 Mar 2024 17:12 UTC

Le 28/03/2024 à 18:07, Stefan Ram a écrit :
> ast <none@none.fr> wrote or quoted:
>> 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.
>> So I came up with this solution:
>> list(chain.from_iterable(zip("AZERTY", "QSDFGH", "WXCVBN")))
>
> Maybe you meant "zip(s1,s2,s3)" as the definition of s1, s2,
> and s3 otherwise would not be required. Also the "list" is not
> necessary because "chain.from_iterable" already is an iterable.
> You could also use "*" instead of "list" to print it. So,
>
> import itertools as _itertools
> s =[ "AZERTY", "QSDFGH", "WXCVBN" ]
> print( *_itertools.chain.from_iterable( zip( *s )))
>
> . But these are only minor nitpicks; you have found a nice solution!

Why did you renamed itertools as _itertools ?

Re: A missing iterator on itertools module?

<underscore-20240328182256@ram.dialup.fu-berlin.de>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: A missing iterator on itertools module?
Date: 28 Mar 2024 17:23:14 GMT
Organization: Stefan Ram
Lines: 25
Expires: 1 Feb 2025 11:59:58 GMT
Message-ID: <underscore-20240328182256@ram.dialup.fu-berlin.de>
References: <66059eb6$0$7522$426a34cc@news.free.fr> <solution-20240328180624@ram.dialup.fu-berlin.de> <6605a515$0$2578$426a74cc@news.free.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de Vn0apQuE0NsS3eljrHupuwEHBNDGDNBvnsdF0I3RG8iqsM
Cancel-Lock: sha1:vpTH1Je2YFa2ueysrIcBNYg6P4Y= sha256:QdwGrwqwr7gVp4g8KJfOEKgJxFiiBvhRWd6K1TPEpw0=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Accept-Language: de-DE-1901, en-US, it, fr-FR
 by: Stefan Ram - Thu, 28 Mar 2024 17:23 UTC

ast <none@none.fr> wrote or quoted:
>Why did you renamed itertools as _itertools ?

Assume I have a module A.py:

import math
def f(): pass

. Assume I have an additional module B.py:

import A

. Now, when I'm editing "B.py" in IDLE and type "A.", IIRC
IDLE will offer me two possible completions: "A.math" and
"A.f". The "A.math" makes no sense to me. I want it to go
away. Therefore, I rewrite A.py as:

import math as _math
def f(): pass

. Now, Idle will only offer the completion "A.f".

So, I sometimes use this "import math as _math" style. But then,
it is simpler for me to /always/ use this style; after all: you
can't know whether someone eventually will import your module!

Re: A missing iterator on itertools module? (Posting On Python-List Prohibited)

<uu4qb1$3r1c8$2@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: ldo@nz.invalid (Lawrence D'Oliveiro)
Newsgroups: comp.lang.python
Subject: Re: A missing iterator on itertools module? (Posting On Python-List
Prohibited)
Date: Thu, 28 Mar 2024 22:18:09 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 7
Message-ID: <uu4qb1$3r1c8$2@dont-email.me>
References: <66059eb6$0$7522$426a34cc@news.free.fr>
<solution-20240328180624@ram.dialup.fu-berlin.de>
<6605a515$0$2578$426a74cc@news.free.fr>
<underscore-20240328182256@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 28 Mar 2024 22:18:10 +0100 (CET)
Injection-Info: dont-email.me; posting-host="6d46a86d4234b3675ba060851576d639";
logging-data="4031880"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WdwcdA9lKOgt+tjR2kweO"
User-Agent: Pan/0.155 (Kherson; fc5a80b8)
Cancel-Lock: sha1:Gac3t3eAzCSFDmVMtH8Btf11Xyk=
 by: Lawrence D'Oliv - Thu, 28 Mar 2024 22:18 UTC

On 28 Mar 2024 17:23:14 GMT, Stefan Ram wrote:

> . Now, when I'm editing "B.py" in IDLE and type "A.", IIRC
> IDLE will offer me two possible completions: "A.math" and
> "A.f". The "A.math" makes no sense to me.

It works, though.

Re: A missing iterator on itertools module?

<uu68ip$8tb8$1@dont-email.me>

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nntp.mbourne@spamgourmet.com (Mark Bourne)
Newsgroups: comp.lang.python
Subject: Re: A missing iterator on itertools module?
Date: Fri, 29 Mar 2024 11:27:20 +0000
Organization: A noiseless patient Spider
Lines: 54
Message-ID: <uu68ip$8tb8$1@dont-email.me>
References: <66059eb6$0$7522$426a34cc@news.free.fr>
<solution-20240328180624@ram.dialup.fu-berlin.de>
<6605a515$0$2578$426a74cc@news.free.fr>
<underscore-20240328182256@ram.dialup.fu-berlin.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 29 Mar 2024 11:27:22 +0100 (CET)
Injection-Info: dont-email.me; posting-host="202926c5daed1b08bb375afddd391b79";
logging-data="292200"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181t6nQkxD9LIYeMl/hKMai"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
SeaMonkey/2.53.18.1
Cancel-Lock: sha1:fAwhkPlwC/6l5+dqOL9YTKZqMmw=
In-Reply-To: <underscore-20240328182256@ram.dialup.fu-berlin.de>
 by: Mark Bourne - Fri, 29 Mar 2024 11:27 UTC

Stefan Ram wrote:
> ast <none@none.fr> wrote or quoted:
>> Why did you renamed itertools as _itertools ?
>
> Assume I have a module A.py:
>
> import math
> def f(): pass
>
> . Assume I have an additional module B.py:
>
> import A
>
> . Now, when I'm editing "B.py" in IDLE and type "A.", IIRC
> IDLE will offer me two possible completions: "A.math" and
> "A.f". The "A.math" makes no sense to me.

`import math` imports the `math` module and binds it to `math` in the
global namespace of the `A` module. Since it doesn't have a leading
underscore, by default it's considered to be a public attribute of the
`A` module, and IDLE is offering all the public attributes of the `A`
module for completion.

> I want it to go
> away. Therefore, I rewrite A.py as:
>
> import math as _math
> def f(): pass
>
> . Now, Idle will only offer the completion "A.f".
>
> So, I sometimes use this "import math as _math" style. But then,
> it is simpler for me to /always/ use this style; after all: you
> can't know whether someone eventually will import your module!

You can explicitly declare the public interface of a module by defining
`__all__`, listing the names which should be considered part of the
module's public interface; see:
- https://docs.python.org/3/reference/simple_stmts.html#the-import-statement
- https://peps.python.org/pep-0008/#public-and-internal-interfaces

Although `from A import *` is generally discouraged, if `A` defines
`__all__` then only the names listed in `__all__` are bound in the
importing module's namespace. Otherwise, all names from `A` which don't
have a leading underscore are considered to be public and bound in the
importing module.

I don't use IDLE, but it may be that it also uses `__all__` to determine
a module's public API. In that case, setting `__all__ = ["f"]` in `A`
should prevent it from offering `math` as a completion (nor any other
name that's not in the `__all__` list).

--
Mark.

Re: A missing iterator on itertools module?

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!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
HknV1xYFiOI9vNtO4fOzwTdElIMhvSOg+5IHKIG9X3NAm
Sr6bWA3cBAQsHTIj4FuUnYe74CfZt1DfsRkmWD7R5dSsP
RN1/kVsM7hBLM5zXh/1upuRvqGvvW0jbRCy+YtZI9Kv+C
IycIwJooMocVbd+VH05Bq42ks/jAEWVDTZkV/5GaAZfb7
mgc5OqasVxsxQwNSJmb+CnshtWg1JUF9s2N7SPXJRer9c
hmqHmwkWG4SVU+wMM4e6vGitz4yc342nidMBtTlGuor2W
2Pw+DACKiIx1h9MuEY7nNM9ZtcDWX4/O8GyjaU3nrFSmQ
2R6Jj4WLXevdGGOgE1rD9M3Hy48JcDGwU3G9du1Y9QpJN
SSKdsX6+LRqND5OeyOr/VbbR98jim4XJy1CSo1v7x6k6l
uwLyCC+TjFSMU1tPU7WRLQAZr5ot+zGLRE2U/NDb0JJJS
kdbTYtgdEuEc1UsnCKqhB2RpOSDCSy+WTk3lmCFukZ2KL
eu3iXNKMsVG8bOhi8B16RFM3t/5z/f5DyLrpbWuyXvKX6
8BBcKtfkuoDUnerpx4Idt/veUDJtzxaag7J4oToRoI/6c
40YHoReJirQvGN8lTp9JughXIP7pHqJ8UDqO6BkhxVFTK
Azcm0xzE+a2an2l8p+PRbYp2yLVGFZvx573vHbCHldl5v
RBIvgXZ5Tv5j0QZRMtmaKyoPdlSMoQqqIZWNXSsCw0wqV
T07MntVNG9ovVbvHMJA/cgW9zATXYyXOimrz0bpvI+6RF
xdnXti0Rz6dxfwK4ja7RVVLoXLlZTYlQpbI5t05ayTiFG
N1hsmQ9Ef6rfMwsgB+o68xFypmEFZ/2YGFosZCKvMHIoW
S4e+E673+D1SPJi6Arv4hCA1n+amQc3T8UN5PTTdx2Ldg
+LcOLVclfPGSgxB8CkzMSpNkki0FLQ0rJG780vvCTTei3
9v2QnkZwBuZLtNL+1C8frHpaoBg8QQedndkOrIfi4kDk4
yIbEdV4VVhGh1mCyQJjtNIjGrARDgiOTgW6qCVhO2GAGu
z+aC0uOsR2jfnr/7DX8+R6isBcpCzw58KHZ3klUzgMUyP
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>
 by: Antoon Pardon - Wed, 3 Apr 2024 09:11 UTC

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.

RE: A missing iterator on itertools module?

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: <avi.e.gross@gmail.com>
Newsgroups: comp.lang.python
Subject: RE: A missing iterator on itertools module?
Date: Wed, 3 Apr 2024 08:14:53 -0400
Lines: 52
Message-ID: <mailman.61.1712146500.3468.python-list@python.org>
References: <66059eb6$0$7522$426a34cc@news.free.fr>
<a8821ec9-2388-4c33-b743-a4ed6f550b99@vub.be>
<004501da85c0$89673b70$9c35b250$@gmail.com>
Mime-Version: 1.0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de fMvnBwKwVAVEohHTkWhZmQWuSd12i9/ETw4YSq5L+nTQ==
Cancel-Lock: sha1:rOOSbkE1hx/zO0CXvWFIthTACr8= sha256:Eic9uXAUMuor44fSB86JpOhJBW4Xhy13+kV/tbafjfE=
Return-Path: <avi.e.gross@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=NnP8LWeW;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.016
X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'partial': 0.07;
'subject:module': 0.07; 'ast': 0.09; 'received:108': 0.09;
'url:mailman': 0.15; "'d',": 0.16; '2024': 0.16; '5:11': 0.16;
'along.': 0.16; 'antoon': 0.16; 'itertools': 0.16; 'mentions':
0.16; 'option.': 0.16; 'pardon': 0.16; 'perhaps,': 0.16; 'received
:mail-qv1-xf29.google.com': 0.16; 'schreef': 0.16; 'shorter':
0.16; 'solution:': 0.16; 'subject:missing': 0.16; 'message-
id:@gmail.com': 0.18; 'to:addr:python-list': 0.20; 'anything':
0.25; '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; 'wednesday,': 0.26; 'function': 0.27;
'done': 0.28; 'url-ip:188/8': 0.31; 'python-list': 0.32; 'but':
0.32; 'there': 0.33; 'same': 0.34; "didn't": 0.34; 'header:In-
Reply-To:1': 0.34; 'received:google.com': 0.34;
'from:addr:gmail.com': 0.35; 'change': 0.36; 'missing': 0.37;
'could': 0.38; 'still': 0.40; 'should': 0.40; 'from:': 0.62;
'to:': 0.62; 'job.': 0.62; 'skip:z 10': 0.62; 're:': 0.64; 'your':
0.64; 'came': 0.65; 'parts': 0.65; 'produce': 0.65; 'order.':
0.69; 'result,': 0.69; 'delivers': 0.76; 'sent:': 0.78; 'parts.':
0.84; 'strings': 0.84; 'stopping': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1712146498; x=1712751298; darn=python.org;
h=thread-index:content-language:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:to:from
:from:to:cc:subject:date:message-id:reply-to;
bh=Y+vyzHHa+35TFsNZhV3sbm3HtBLXaa34g6Q/ZWBn4lI=;
b=NnP8LWeWm9oLNKr4r7Zn6P7iJw00HdJ38BKxD267xLIWH3PpnnYuG6JcQgI9CAam0z
M+xgvdy3EUB2Sdd+dgytau0tWP9lGNqUK/cGSe//p46aAYSdLBCpkZaMId3Y+7zzL89b
b9C1deSVk2+fXfRWCLrycCwwhT3Or4pyMr+TiYky6THxo1Y/cYQmbqZeqFLLFMAIo4ao
Dg5KadEofJCk9VHNhMYr1ZRY4W/BblcvB8ygLH98RRF4l4lsSbR6aUvdaxfg06I1WgbG
7df7aoCBQe+/goDLH+XBWc3o5o13BitGS173kB2bhzDBpWhjN6woZseIewdLrz8Gsi3Y
/0jQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1712146498; x=1712751298;
h=thread-index:content-language:content-transfer-encoding
:mime-version:message-id:date:subject:in-reply-to:references:to:from
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
bh=Y+vyzHHa+35TFsNZhV3sbm3HtBLXaa34g6Q/ZWBn4lI=;
b=R4J/Z2n81lf7zh/rmn4yi0IEDv0ADN8YFQJQhhCfmlQhG2err3006lE0FpH44xwuJn
yhRI4pbB8TkOGX275KW3K6x21p9lTnvtbf9piOlwaPcwnocIQFocQSqdygMSkEPcil+F
iVAupMxeCJOxqzXx5XGXW3Q+vWvDOvOkOwwpg/Enfp6ALbdvZjTwji+poczQM0gNqlHN
TVxH1jeQZSO+Hgx5X/pCSfSVrJJFsfxw7ClEILTf307s1/LcexVS9zThbM2emYbyrOOo
8KOxwonwsLuH5q/ZPT2X/ql4eMHBNIO71QOAYp2FM0rTKKTvaV903kZ3cUdxf2CMKeU0
sokg==
X-Forwarded-Encrypted: i=1;
AJvYcCU2kGLrd1sYrwrK1dfj2mAYFDNRpIhlyA0/GkbQAAUgyC3/R+09vFP6njsomcTNhtqhF66wfk563ZwFcQE+3BAypueyr+g6
X-Gm-Message-State: AOJu0YwaQLwbA8GTn5PwVpd0+kKQ6MBntDo6Mw7ocSrroh7NPepxKtBG
MQUio3Lx3wx/y5UBtMIe5XfJdAYomRXoT2UU8c2bJTykapUX5Fqc
X-Google-Smtp-Source: AGHT+IGGOgrUE9zsZPXsXQ1RqOBuFr4vsCj5Dv0C3FRtqf/qj/+0MtnlSnqBLOVGSgRHc7zUTNlsAA==
X-Received: by 2002:a0c:ea8f:0:b0:699:28b2:2dd1 with SMTP id
d15-20020a0cea8f000000b0069928b22dd1mr1175990qvp.41.1712146498462;
Wed, 03 Apr 2024 05:14:58 -0700 (PDT)
In-Reply-To: <a8821ec9-2388-4c33-b743-a4ed6f550b99@vub.be>
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQLoDA44Zb1+7rwvqQQYL1T+A6T12gKzLh1kryXNnFA=
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: <004501da85c0$89673b70$9c35b250$@gmail.com>
X-Mailman-Original-References: <66059eb6$0$7522$426a34cc@news.free.fr>
<a8821ec9-2388-4c33-b743-a4ed6f550b99@vub.be>
 by: <avi.e.gross@gmail.com> - Wed, 3 Apr 2024 12:14 UTC

Antoon,

Even if the suggested solution offers a partial result, you would need
specific requirements to determine what should be done if one or more of the
parts being cycled is shorter than the others. Stopping at that point is one
option. Another is to continue but only interleave ones still producing and
in the same order.

There is a function in itertools called zip_longest() that might be
considered as it keeps going but substitutes a customizable value for
"missing" parts. You could then, perhaps, make a change so that sentinel is
not passed along.

-----Original Message-----
From: Python-list <python-list-bounces+avi.e.gross=gmail.com@python.org> On
Behalf Of Antoon Pardon via Python-list
Sent: Wednesday, April 3, 2024 5:11 AM
To: python-list@python.org
Subject: Re: A missing iterator on itertools module?

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.
--
https://mail.python.org/mailman/listinfo/python-list

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor