Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

A triangle which has an angle of 135 degrees is called an obscene triangle.


devel / comp.lang.python / Re: All permutations from 2 lists

SubjectAuthor
o Re: All permutations from 2 listsLarry Martell

1
Re: All permutations from 2 lists

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: larry.ma...@gmail.com (Larry Martell)
Newsgroups: comp.lang.python
Subject: Re: All permutations from 2 lists
Date: Wed, 2 Mar 2022 17:05:28 -0500
Lines: 26
Message-ID: <mailman.104.1646258767.2329.python-list@python.org>
References: <CACwCsY7piDPzzCtPy93OCdOQapBech6JMDjQijXZ0rpaiiUPqQ@mail.gmail.com>
<Yh/icMT9L6po0lij@cskk.homeip.net>
<CACwCsY5wGtwR-7kswMTQgvrH8ccL7_cPfZWW9ve=aGQMGDAQVw@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de IXQbgs9jTAIh4eil2DtPqQ9B1m5SIv+ozoCqoFAlnU5Q==
Return-Path: <larry.martell@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=WTwonaX9;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.008
X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '2022': 0.05; 'issue.':
0.05; 'mar': 0.07; 'received:209.85.219': 0.09; 'import': 0.15;
'5:00': 0.16; 'cameron': 0.16; 'expectation': 0.16; 'itertools':
0.16; 'program:': 0.16; 'simpson': 0.16; 'solved': 0.16;
'subject:lists': 0.16; 'wrote:': 0.16; 'tue,': 0.19; 'to:addr
:python-list': 0.20; "i've": 0.22; 'skip:p 30': 0.23; 'expect':
0.28; 'default': 0.31; 'think': 0.32; 'question': 0.32; 'empty':
0.32; 'to:name:python': 0.32; 'message-id:@mail.gmail.com': 0.32;
'header:In-Reply-To:1': 0.34; 'received:google.com': 0.34;
'from:addr:gmail.com': 0.35; 'subject:from': 0.37;
'received:209.85': 0.37; 'could': 0.38; 'received:209': 0.39;
'single': 0.39; 'list': 0.39; 'wed,': 0.39; 'wrote': 0.39; 'want':
0.40; 'personal': 0.64; 'need.': 0.84; 'rob': 0.84; 'subject:All':
0.84; 'said.': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
bh=xRxC5+k2mxZe+p4cymIvJTA8c5LyucHz1HjW95DYvX0=;
b=WTwonaX9qxVvCzs64s6s89b7bJdr6EQhu7AFGCPMV5SLm5pEs1HbDRJVuAmB6xprur
jprPNf2ltRYiJzqq196v0uqqjJIJ+NGKKdd1zXaOFbuq4GlTis1bc5SlTHd4bbYrWCin
gi/TCBnwsaOSOaivZjHe0kQ0WG5VEruTedcCBrXzIXPSqelh4g64ohZw8riRMPQQsjUU
nfBJp6diQ/fXOTynMKzqfgYnimFMhkHlti1fayKg1KzHugHkyzRd82u9iaPfsAUrkzin
oL6PJwaauKTq/MAEix2ff03Sug9STRVsM8IMzg6CeYrm1OIkOYQtQVssFIxYLleOVSwk
ZICg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
:message-id:subject:to;
bh=xRxC5+k2mxZe+p4cymIvJTA8c5LyucHz1HjW95DYvX0=;
b=L3x2VraRHe5N2V0Tc2yqs1MHPLMm2j8Hjapht3QxEHKmdtM3PDTkITOeFtn/+F2XeI
f5r1R5sm7WRAMSytKrvSXb9+ksiNtWxWgFtJNxGLtE7vEqEpPih4sQ0HF234GIggBkqh
5zTkUpzAT9La1FncHN6fAeZLZfJEMVxXfyncyTHiT8Tr/a3qD9iX94v7jAS7YlkbQx8G
GhnEtenJPfHuF+bARZPqrzpOkYxVgd6nbcxzCBqSdRb6CaQxtY987IJw+LlS98FWoCIe
MqaQdVq+HHqZC+OjRuUHhz0uG6R+urx4grr3vT0KyThX3HoodtPryXfJlToT2YbxXWCm
Zwow==
X-Gm-Message-State: AOAM533yKINrKQYsHpd9iC+ttgoSUBbCYmZnjcdheMZZWJd0QMFqAN27
gahXrZ23jSTkLs7nLVmyWj+iw732mB3qjsy2FkxfWn0=
X-Google-Smtp-Source: ABdhPJzpEM6uQREQSKlTO283YUZ1DhNK5jqaukIx5xgWTyCzW2ZLQVEbJqGaGR4ivlVZyHnFujut0/6wE7bi8Z7X/wk=
X-Received: by 2002:a05:6214:1548:b0:432:a21a:2759 with SMTP id
t8-20020a056214154800b00432a21a2759mr21068500qvw.88.1646258765174; Wed, 02
Mar 2022 14:06:05 -0800 (PST)
In-Reply-To: <Yh/icMT9L6po0lij@cskk.homeip.net>
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: <CACwCsY5wGtwR-7kswMTQgvrH8ccL7_cPfZWW9ve=aGQMGDAQVw@mail.gmail.com>
X-Mailman-Original-References: <CACwCsY7piDPzzCtPy93OCdOQapBech6JMDjQijXZ0rpaiiUPqQ@mail.gmail.com>
<Yh/icMT9L6po0lij@cskk.homeip.net>
 by: Larry Martell - Wed, 2 Mar 2022 22:05 UTC

On Wed, Mar 2, 2022 at 5:00 PM Cameron Simpson <cs@cskk.id.au> wrote:
>
> On 02Mar2022 08:29, Larry Martell <larry.martell@gmail.com> wrote:
> >On Tue, Mar 1, 2022 at 7:32 PM Rob Cliffe <rob.cliffe@btinternet.com> wrote:
> >> I think itertools.product is what you need.
> >> Example program:
> >>
> >> import itertools
> >> opsys = ["Linux","Windows"]
> >> region = ["us-east-1", "us-east-2"]
> >> print(list(itertools.product(opsys, region)))
> >
> >This does not work if region = []. I wrote in question that either
> >list could be empty.
>
> What do you want to get if a list is empty? You haven't said. My
> personal expectation would be an empty result.
>
> Alternatively, if you expect an empty list to imply some single default
> the the experession:
>
> the_list or (the_default,)
>
> might be of use.

I've solved the issue.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor