Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Real Users are afraid they'll break the machine -- but they're never afraid to break your face.


devel / comp.lang.python / Re: Superclass static method name from subclass

SubjectAuthor
o Re: Superclass static method name from subclassThomas Passin

1
Re: Superclass static method name from subclass

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: lis...@tompassin.net (Thomas Passin)
Newsgroups: comp.lang.python
Subject: Re: Superclass static method name from subclass
Date: Fri, 11 Nov 2022 19:07:03 -0500
Lines: 25
Message-ID: <mailman.937.1668213961.20444.python-list@python.org>
References: <ddbbb03e-4c0f-caa4-045f-4e745785ae3f@gmail.com>
<1686043e-1dbb-e284-9f76-f8be1c0e63b4@tompassin.net>
<f4aae392-9ccb-8b8d-65b8-ad6deb1dc028@gmail.com>
<2c97a527-2c46-e65f-0e19-bf53c8d994b2@tompassin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de PcFHLGG1UG3EGb1KjhweWg+k60ASxTxqFR54e46e/RVA==
Return-Path: <list1@tompassin.net>
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=tompassin.net header.i=@tompassin.net header.b=jqma5EnW;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.002
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'skip:@ 10': 0.03; 'def':
0.04; 'subject:name': 0.07; 'prints': 0.09; 'received:23.83.212':
0.09; 'received:elm.relay.mailchannels.net': 0.09; 'skip:\xc2 20':
0.09; '@classmethod': 0.16; 'anyway.': 0.16; 'received:10.0.0':
0.16; 'received:64.90': 0.16; 'received:64.90.62': 0.16;
'received:64.90.62.162': 0.16; 'received:dreamhost.com': 0.16;
'wrote:': 0.16; 'python': 0.16; 'instead': 0.17; 'probably': 0.17;
'pm,': 0.19; 'to:addr:python-list': 0.20; 'written': 0.22;
'thanks!': 0.24; 'help.': 0.25; 'seems': 0.26; 'header:User-
Agent:1': 0.30; 'received:10.0': 0.32;
'received:mailchannels.net': 0.32;
'received:relay.mailchannels.net': 0.32; 'but': 0.32; 'header:In-
Reply-To:1': 0.34; 'subject:from': 0.37; "it's": 0.37; 'class':
0.37; 'could': 0.38; 'define': 0.40; 'should': 0.40; 'skip:\xc2
10': 0.62; 'header:Received:6': 0.67; 'received:64': 0.67;
'subject:method': 0.69; '8bit%:100': 0.76;
'\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0': 0.84;
'\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0\xc2\xa0': 0.84; 'glad':
0.86
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1668211624; a=rsa-sha256;
cv=none;
b=fxBOZtz+tB+Ln1h/uKChfcm+rkR6H7XqU1pMfa4NAyc8WAxoZvOKSiLidEG7K0iCZDkXsN
PrPAnhCOn7rEuYlBZ3kaoEqcReZLSVnnKP1FwMPUMj5+db6ChIDyG33r/px6zEuEddo9hR
fbGEOoDqcdKlCTxoaCpPztgKZ8i1CKoGlvnPAiUQ+41bRH9vGIaNmNRsl0NtEqPVLBZtHJ
DjJCQMBAI5W5y0k/aeUvHX0J+9M4xzJspD6tBjWIF0oOfVHiPFK2c9raCoUeoWDp0PBNmz
g8QKBte4mhnA0z9H3yQn5jPKpxaayMXaULyem2PaVXTSOhb294neClszG+8qNA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
d=mailchannels.net; s=arc-2022; t=1668211624;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references:dkim-signature;
bh=zC33l21zaBvDWvun2O2Q00M7h5NELM+qPxXNhqGyn9k=;
b=f8/+l9FX0NW0DgSpvpffciyd+h3sGVnKf9gc1Y9Ix6L2jaIpVJcYRj5I/xXuNJqCkTE/+G
0CYvBxpN0VMR1YCitIzl0QxKqgzjZxl+MrsjqKfYhkCJzcHvUobBAPb5EaAjSFUgMOo0DY
0nOS9lR03Nh/IWBYnTZ/pzsanrpPVBstFXQ3ujRdqgICwjza9DTRyEGxejZYMWyOpdpEYm
g3OEwdlbkkizcSL1JXzd2DnLZzfkg7WHgSOjb/KsAK8dY3j9bHrzacXjyven84tp23RF+N
fMXsV0i67IZoIwPXF8wpLHNtPVGNc0qlY+mNtC5LW94vcKptNpKu5ntELQQPxA==
ARC-Authentication-Results: i=1; rspamd-5cb65d95c4-sqctg;
auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|tpassin@tompassin.net
X-MailChannels-Auth-Id: dreamhost
X-Oafish-Zesty: 5976d4151becbd0a_1668211624454_3400044256
X-MC-Loop-Signature: 1668211624453:3794142737
X-MC-Ingress-Time: 1668211624453
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net;
s=dreamhost; t=1668211624;
bh=zC33l21zaBvDWvun2O2Q00M7h5NELM+qPxXNhqGyn9k=;
h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding;
b=jqma5EnWcQpHNK/9fp4dPQ73b9SgApbKHTjQ6raIoQ+2xthaS26VZck9pckB4hjlH
v8GZHx8PYu4Gyx8ZUnC4Gn+nKB6lcpDEPMQ6dcNo4c9+evc0KVrLZ7k5uzeW0i4UhR
Euaishf6jaFk+U3mhlndPQvDtepCrfTggTWjxN2SY8R0zTKzLoPdkJPbK273p792P7
mr+Szi4z3L/xwEhgD0wjpL5ir8uo9buX9lxnwF4+cXMes9yOHZTntgOExXhBtXOQHn
FQY82Tb+JFf8YFHfwgrU3cKl05J2GQZYUKEcYVHsyrTuJlY+hh0ForLZb1jEa8s/rW
W+3xTDnG/E88g==
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.4.2
Content-Language: en-US
In-Reply-To: <f4aae392-9ccb-8b8d-65b8-ad6deb1dc028@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: <2c97a527-2c46-e65f-0e19-bf53c8d994b2@tompassin.net>
X-Mailman-Original-References: <ddbbb03e-4c0f-caa4-045f-4e745785ae3f@gmail.com>
<1686043e-1dbb-e284-9f76-f8be1c0e63b4@tompassin.net>
<f4aae392-9ccb-8b8d-65b8-ad6deb1dc028@gmail.com>
 by: Thomas Passin - Sat, 12 Nov 2022 00:07 UTC

On 11/11/2022 5:07 PM, Ian Pilcher wrote:
> On 11/11/22 11:02, Thomas Passin wrote:
>> You can define a classmethod in SubClass that seems to do the job:
>>
>> class SuperClass(object):
>>        @staticmethod
>>        def spam():  # "spam" and "eggs" are a Python tradition
>>            print('spam from SuperClass')
>>
>> class SubClass(SuperClass):
>>      @classmethod
>>      def eggs(self):
>>          super().spam()
>>
>> SubClass.eggs()  # Prints "spam from SuperClass"
>
>
> That did it!  Thanks!

Glad I could help. I probably should have written

def eggs(clas): # instead of "self"

but it's not actually used anyway.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor