Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

We cannot command nature except by obeying her. -- Sir Francis Bacon


devel / comp.lang.python / Re: type annotation vs working code

SubjectAuthor
o Re: type annotation vs working codedn

1
Re: type annotation vs working code

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: PythonL...@DancesWithMice.info (dn)
Newsgroups: comp.lang.python
Subject: Re: type annotation vs working code
Date: Wed, 4 Oct 2023 21:05:29 +1300
Organization: DWM
Lines: 30
Message-ID: <mailman.395.1696406739.23016.python-list@python.org>
References: <ZRhwWN29i3mskxEL@hermes.hilbert.loc>
<ecc36615-1844-455f-b701-2bd41d98e9e1@DancesWithMice.info>
<ZRigRwHpNReUo5rF@hermes.hilbert.loc>
<4f1c9568-3850-4847-b357-740f79b0a79b@DancesWithMice.info>
<ZRlelmUwOR/wcPqR@hermes.hilbert.loc>
<f093d0a9-67b3-4baa-baae-3666c9847a14@DancesWithMice.info>
<CAPTjJmo+2YfF7cty7f_NeG-7K-aRzvKPivu6jYLtDT1qmrCCTQ@mail.gmail.com>
<0a9e9d76-aeb4-4e68-84bb-927ffbd63859@DancesWithMice.info>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de MvsETE1DcgY70ZbsktGGkwNQyT3P4rZ1wyhr4sIIZNjg==
Cancel-Lock: sha1:zgZdwk027cfYpC5XiFIwkg1XD/g= sha256:As5yzegRKL2kffjifZESLtWGo52m4DoE7Q/LR2YETtM=
Return-Path: <PythonList@DancesWithMice.info>
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=danceswithmice.info header.i=@danceswithmice.info
header.b=ZAATRc6f; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.003
X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'bunch': 0.05; '2023':
0.07; 'class.': 0.07; '=dn': 0.09; 'angelico': 0.09;
'from:addr:danceswithmice.info': 0.09; 'from:addr:pythonlist':
0.09; 'other.': 0.09; 'received:192.168.1.64': 0.09; 'intent':
0.16; 'message-id:@DancesWithMice.info': 0.16; 'perhaps,': 0.16;
'received:cloud': 0.16; 'received:rangi.cloud': 0.16;
'subject:code': 0.16; 'subject:working': 0.16; 'wrote:': 0.16;
"aren't": 0.19; 'to:addr:python-list': 0.20; 'communicate': 0.22;
'classes': 0.26; 'chris': 0.28; 'header:User-Agent:1': 0.30;
'header:Organization:1': 0.31; 'think': 0.32; 'python-list': 0.32;
'received:192.168.1': 0.32; 'but': 0.32; "i'm": 0.33; 'same':
0.34; 'header:In-Reply-To:1': 0.34; 'yes,': 0.35; 'really': 0.37;
"it's": 0.37; 'class': 0.37; 'received:192.168': 0.37; 'could':
0.38; 'means': 0.38; 'use': 0.39; 'wed,': 0.39; 'otherwise,':
0.40; 'should': 0.40; 'remember': 0.61; 'imagine': 0.64;
'similar': 0.65; 'right': 0.68; 'order': 0.69; 'skeleton': 0.84;
'subject:type': 0.91
DKIM-Filter: OpenDKIM Filter v2.11.0 vps.rangi.cloud C8EDB445C
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=danceswithmice.info;
s=staff; t=1696406736;
bh=2A2PUKxamlnJBnt9PehvaDp18W5D9L7sVC3EQnvIEQI=;
h=Date:Subject:To:References:From:In-Reply-To:From;
b=ZAATRc6fl/Rde+ixRDE7BNX91wstaxWbbUgcy0E9lL1st5db2lS/WJuYEnXIPrBtB
M86nnIOSf1/l1RrDlDM4oTNO8I25VaVdBCzWziZ2u41AN2UvpYP27ocD8+i4YczZnm
JbA8jIJJ6OSk8azmKryrP86iROTZQptvwIvM56/H2CdGcb8fYAvyWsklQBvZekhiHD
BexnQyUL3yYki7oOl/yLZpNh5AcSXeEYFjKdwGhWViCYr2zYxI3j/0jTSVz8lve5GH
BGnq7LjpNW42a293MMzFPDDoqj7aZHHInfT5L0xWrpoNfMjvXEO5Lq7tdCbSoMwV73
kRTGagXSp5QGA==
User-Agent: Mozilla Thunderbird
Content-Language: en-GB
In-Reply-To: <CAPTjJmo+2YfF7cty7f_NeG-7K-aRzvKPivu6jYLtDT1qmrCCTQ@mail.gmail.com>
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: <0a9e9d76-aeb4-4e68-84bb-927ffbd63859@DancesWithMice.info>
X-Mailman-Original-References: <ZRhwWN29i3mskxEL@hermes.hilbert.loc>
<ecc36615-1844-455f-b701-2bd41d98e9e1@DancesWithMice.info>
<ZRigRwHpNReUo5rF@hermes.hilbert.loc>
<4f1c9568-3850-4847-b357-740f79b0a79b@DancesWithMice.info>
<ZRlelmUwOR/wcPqR@hermes.hilbert.loc>
<f093d0a9-67b3-4baa-baae-3666c9847a14@DancesWithMice.info>
<CAPTjJmo+2YfF7cty7f_NeG-7K-aRzvKPivu6jYLtDT1qmrCCTQ@mail.gmail.com>
 by: dn - Wed, 4 Oct 2023 08:05 UTC

On 04/10/2023 19.41, Chris Angelico via Python-list wrote:
> On Wed, 4 Oct 2023 at 15:27, dn via Python-list <python-list@python.org> wrote:
>> - should the class have been called either;
>>
>> class SomethingSingleton():
>>
>> or a Singleton() class defined, which is then sub-classed, ie
>>
>> class Something( Singleton ):
>>
>> in order to better communicate the coder's intent to the reader?
>
> TBH, I don't think it's right to have a Singleton class which is
> subclassed by a bunch of different singletons. They aren't really
> subclasses of the same class. I could imagine Singleton being a
> metaclass, perhaps, but otherwise, they're not really similar to each
> other.

I'm with you on this - should have made Singleton() an ABC.

Yes, would only be a skeleton around which concrete singleton classes
could be built.

Like you, I v.rarely use them - but which means that the ABC is useful
because it would save me from having to remember the curly-bits
all-over-again...

--
Regards,
=dn

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor