Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

As Will Rogers would have said, "There is no such things as a free variable."


devel / comp.lang.python / Python C API: how to mark a type as subclass of another type

SubjectAuthor
o Python C API: how to mark a type as subclass of another typeMarco Sulla

1
Python C API: how to mark a type as subclass of another type

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: elbar...@gmail.com (Marco Sulla)
Newsgroups: comp.lang.python
Subject: Python C API: how to mark a type as subclass of another type
Date: Sun, 31 Oct 2021 23:59:49 +0100
Lines: 9
Message-ID: <mailman.161.1635721228.23718.python-list@python.org>
References: <CABbU2U9EbBES+CU3OwXqY_9T0LVT6rYUFzy3e-rebGQ53zHOyw@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de +/RKNuxHNc8D33X1jhIMOAQUMmg5nu3leGl+Rt9WUmHw==
Return-Path: <elbarbun@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=brA11Ebb;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.033
X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'subject:API': 0.07;
'received:209.85.219': 0.09; 'subject:how': 0.09;
'subject:Python': 0.12; 'declared': 0.16; 'from:name:marco sulla':
0.16; 'one?': 0.16; 'to:addr:python-list': 0.20; 'skip:p 30':
0.23; 'tried': 0.26; 'message-id:@mail.gmail.com': 0.32; 'mark':
0.32; 'but': 0.32; "didn't": 0.34; 'work.': 0.34;
'received:google.com': 0.34; 'from:addr:gmail.com': 0.35;
'received:209.85': 0.37; 'received:209': 0.39; 'two': 0.39; 'use':
0.39; 'types': 0.67; 'subject:another': 0.84; 'subject:type': 0.91
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;
h=mime-version:from:date:message-id:subject:to;
bh=D8GZ3FRYJg0VxTJgCR27ddi+vibrzSR/UZhy99sPJ8E=;
b=brA11EbbZ6YMROulqwMi042/5c1MqDs9mTV2Jb5MR8N5F+zVkpHO7L1/8KTpJcPRLf
7QweYNfqw/28ELByy1BFyXaRIMSJZeSGas2bt+QtuCfshQO+7IYRBYe/DJ111XNtfp3M
tUor/P8sBPdqsgAGKplJTaymhjri3w7xSH85WarUhr+J5rYbSQ1Y3RXNdQhZb6zQ16cD
C4jDHmVTiwN1fuAKz2vw68UQz3x//q2ibPOd4l/crhf43ikarTjAG1nfAMya/NTSVAok
kmIDWWKxeMyN/KTei32lAzaJMTErvaSVzBqlp5ejkt50wz/2d2JL5jEW8v2hqxmMXoig
s+BA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20210112;
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
bh=D8GZ3FRYJg0VxTJgCR27ddi+vibrzSR/UZhy99sPJ8E=;
b=tF5D7439sElWSwkcC12SUbjPUd7dlqA74EMGqEhe5nRsKGF1C8gmAN/vcOIr891Z3M
UL5mRJ92uKHAGSb5P/LLVUJAYJQLqDiJvJ/gFzSSB45/KtbscPJn2C27yE+3bFgiG+mH
XqgN82rRNDuYsAM+8uG1+l63XRWWEfX5VRuNpydJpdm7JzJPxU51S5KY8ykYdtbDb3Pl
+99p4xf1PmVw4Cog/WSeZ8jAqfRXkxsAZhtgJvjyYROLjoc9AoGR2zz7nNdkkW/0oAwM
S9hZEMNVzWbUCFMjybDBmcM+NOuUf8culIrfqObsD+3+WsVimPsd0gAz/5SZ/S7TGosI
ebLw==
X-Gm-Message-State: AOAM531NyNK4yWHHsq4CLGVWkydCc9kkOXfiN1Ob5iW3IhWDXK2v1GEp
+cZtAKz4efzPUubdTgeMpAHRi5zeLK1VsHN3TnCQiGrGkn0=
X-Google-Smtp-Source: ABdhPJydiAuzQO131/RihjkV300hIGSWQogxI/SQHCd2NZzf7nSCETfA95EBFzNl/oP7kDqAdCn5sW/ZdwI8E4CEwOk=
X-Received: by 2002:a25:b687:: with SMTP id s7mr10743489ybj.28.1635721225362;
Sun, 31 Oct 2021 16:00:25 -0700 (PDT)
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.35
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: <CABbU2U9EbBES+CU3OwXqY_9T0LVT6rYUFzy3e-rebGQ53zHOyw@mail.gmail.com>
 by: Marco Sulla - Sun, 31 Oct 2021 22:59 UTC

I have two types declared as

PyTypeObject PyX_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)

etc.

How can I mark one of the types as subclass of the other one? I tried
to use tp_base but it didn't work.

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor