Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

"Everyone is entitled to an *informed* opinion." -- Harlan Ellison


devel / comp.lang.python / Re: Is there a better way to create a list of None objects?

SubjectAuthor
* Is there a better way to create a list of None objects?Stephen Tucker
`- Re: Is there a better way to create a list of None objects?Python

1
Is there a better way to create a list of None objects?

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: stephen_tucker@sil.org (Stephen Tucker)
Newsgroups: comp.lang.python
Subject: Is there a better way to create a list of None objects?
Date: Thu, 12 Aug 2021 09:57:33 +0100
Lines: 47
Message-ID: <mailman.361.1628758671.4164.python-list@python.org>
References: <CAP=-cKVMTHJRG0m1PW3PGwaWcwDC8UXXffAsHM9q-gnVeB584A@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de l324PlVnzkPI1NJs48pDCQoe8uXUaB0xuFlzc6JoDW3w==
Return-Path: <stephen_tucker@sil.org>
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=sil.org header.i=@sil.org header.b=FELgvPXZ;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.098
X-Spam-Evidence: '*H*': 0.80; '*S*': 0.00; 'wanting': 0.07;
'typeerror:': 0.09; 'subject:list': 0.11; '(b)': 0.16; 'effect:':
0.16; 'note.': 0.16; 'received:209.85.217': 0.16; 'subject:way':
0.16; 'things,': 0.16; 'invite': 0.20; 'language': 0.22; "i'd":
0.23; 'to:addr:python-list': 0.23; 'code': 0.24; 'written': 0.24;
'recently': 0.26; 'done': 0.28; 'comment': 0.28; 'effect': 0.28;
'empty': 0.32; 'stephen': 0.32; 'to:name:python': 0.32; 'message-
id:@mail.gmail.com': 0.33; 'community.': 0.34;
'received:google.com': 0.34; 'following': 0.35; 'received:209.85':
0.38; 'others': 0.38; 'received:209': 0.38; 'hi,': 0.39; 'list':
0.39; 'check': 0.62; 'here': 0.62; 'share': 0.63; 'skip:# 10':
0.64; '8bit%:88': 0.65; 'similar': 0.66; 'piece': 0.69; 'below':
0.71; '8bit%:92': 0.75; 'limits': 0.77; 'inform': 0.79; '(c)':
0.81; 'subject:better': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sil.org; s=google;
h=mime-version:from:date:message-id:subject:to;
bh=fFHXdvvl/M5+cdxz0d6UdAc5t1snrtv1V1Zq9lrxcIc=;
b=FELgvPXZjmmwfNSKdB68724EVJpoMLvlnrx/LSoEIw0Y/JmhvU2mTWtdWNJ+6VIzb+
XaDw6Z1P8ZmXJfH1KUVzDEaK4A30+mPAfQndjGaXBRhWlImkOO36hsk565qKR4M0Hm3C
jqQ2813aNaWUPUPZVezyLtzzdDOgF2ltiSYts=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
bh=fFHXdvvl/M5+cdxz0d6UdAc5t1snrtv1V1Zq9lrxcIc=;
b=WtZXWZyqsIwpic7vP10Rutbofl5rQej1h7ko1YroEGMyfl5KVGibcw4Bv6wN871TCS
b/Az9nzkFYt8bRNUp89WGf4qHA2Q7cRqzEsqqYFECsr5nYrRzLhvamXohf0PJx4bkaHc
VywQoM/J4oWIuFVN9IVVYseghBIpyypEUnpKzIoXlRW82bi9t//NXi5mtV3irrSrnbmS
23dCMiyZZoXwCyMf81gByFKVdSG3tm/i8wPy0lgKzn3/07fhH0Gh7Lc0qvdWDamO5c6C
wIAQ9ZALFAMPzDxQByVSwXXWwTxdh5lZjKS4kcy1CpF6JqxUZZzD+mTbbFch3MlpwgHB
OE5Q==
X-Gm-Message-State: AOAM533BgSwFufrv4Mq81z1BB194/Fj+MTkwe0UrCQsRGhtwiTKFLEA/
XZaLHgPz7kwIzFa0p3THMfgch5zFKmiiGeB8rmKe4DmLcalQQw==
X-Google-Smtp-Source: ABdhPJzPEsyzP8LNLwRZrioI7hAIv05MP9wyd9m9zVVeaCXiGdxcDxb46LIVR5Q18zcKjYrCwjAqY6Wrf5zHISVSpZs=
X-Received: by 2002:a67:3303:: with SMTP id z3mr2025990vsz.51.1628758668415;
Thu, 12 Aug 2021 01:57:48 -0700 (PDT)
X-Content-Filtered-By: Mailman/MimeDel 2.1.34
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.34
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: <CAP=-cKVMTHJRG0m1PW3PGwaWcwDC8UXXffAsHM9q-gnVeB584A@mail.gmail.com>
 by: Stephen Tucker - Thu, 12 Aug 2021 08:57 UTC

Hi,

I thought I'd share the following piece of code that I have recently written
(a) to check that what I have done is reasonable - even optimum,
(b) to inform others who might be wanting to do similar things, and
(c) to invite comment from the community.

-------------------------------------------

#

# Yes: Create an empty list of Band Limits for this language

#

# Note. The rather complicated logic on the right-hand side of the

# assignment below is used here because none of the following

# alternatives had the desired effect:

#

# Logic Effect

#

# [None * 8] TypeError: unsupported operand type(s) for *: ...

# [(None) * 8] TypeError: unsupported operand type(s) for *: ...

# [((None)) * 8] TypeError: unsupported operand type(s) for *: ...

# [(None,) * 8] [(None, None, None, None, None, None, None, None)]

# list ((None) * 8) TypeError: unsupported operand type(s) for *: ...

#

diclll_BLim [thisISO_] = list ((None,) * 8)

-------------------------------------------

Thanks in anticipation.

Stephen Tucker.

Re: Is there a better way to create a list of None objects?

<6114e4fa$0$21584$426a74cc@news.free.fr>

  copy mid

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

  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!cleanfeed2-a.proxad.net!nnrp1-1.free.fr!not-for-mail
Subject: Re: Is there a better way to create a list of None objects?
Newsgroups: comp.lang.python
References: <CAP=-cKVMTHJRG0m1PW3PGwaWcwDC8UXXffAsHM9q-gnVeB584A@mail.gmail.com>
<mailman.361.1628758671.4164.python-list@python.org>
From: python@python.invalid (Python)
Date: Thu, 12 Aug 2021 11:08:32 +0200
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0)
Gecko/20100101 Thunderbird/78.12.0
MIME-Version: 1.0
In-Reply-To: <mailman.361.1628758671.4164.python-list@python.org>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: fr
Content-Transfer-Encoding: 8bit
Lines: 53
Message-ID: <6114e4fa$0$21584$426a74cc@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 12 Aug 2021 11:08:10 CEST
NNTP-Posting-Host: 176.150.91.24
X-Trace: 1628759290 news-2.free.fr 21584 176.150.91.24:61841
X-Complaints-To: abuse@proxad.net
 by: Python - Thu, 12 Aug 2021 09:08 UTC

Le 12/08/2021 à 10:57, Stephen Tucker a écrit :
> Hi,
>
> I thought I'd share the following piece of code that I have recently written
> (a) to check that what I have done is reasonable - even optimum,
> (b) to inform others who might be wanting to do similar things, and
> (c) to invite comment from the community.
>
> -------------------------------------------
>
> #
>
> # Yes: Create an empty list of Band Limits for this language
>
> #
>
> # Note. The rather complicated logic on the right-hand side of the
>
> # assignment below is used here because none of the following
>
> # alternatives had the desired effect:
>
> #
>
> # Logic Effect
>
> #
>
> # [None * 8] TypeError: unsupported operand type(s) for *: ...
>
> # [(None) * 8] TypeError: unsupported operand type(s) for *: ...
>
> # [((None)) * 8] TypeError: unsupported operand type(s) for *: ...
>
> # [(None,) * 8] [(None, None, None, None, None, None, None, None)]
>
> # list ((None) * 8) TypeError: unsupported operand type(s) for *: ...
>
> #
>
> diclll_BLim [thisISO_] = list ((None,) * 8)
>
>
> -------------------------------------------
>
> Thanks in anticipation.
>
> Stephen Tucker.
>

[None] * 8


devel / comp.lang.python / Re: Is there a better way to create a list of None objects?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor