Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Without life, Biology itself would be impossible.


devel / comp.lang.python / Re: C API PyObject_CallFunctionObjArgs returns incorrect result

SubjectAuthor
o Re: C API PyObject_CallFunctionObjArgs returns incorrect resultChris Angelico

1
Re: C API PyObject_CallFunctionObjArgs returns incorrect result

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: ros...@gmail.com (Chris Angelico)
Newsgroups: comp.lang.python
Subject: Re: C API PyObject_CallFunctionObjArgs returns incorrect result
Date: Tue, 8 Mar 2022 04:09:37 +1100
Lines: 13
Message-ID: <mailman.236.1646672989.2329.python-list@python.org>
References: <MxWmaxK--3-2@tutanota.com>
<5ad962fc-1257-dd8d-96ab-541ae5bae2fa@mrabarnett.plus.com>
<Mx_KxMD--3-2@tutanota.com>
<CAPTjJmrcOZVwB0g+aScJ7V8svx1_iW-jeOsNUdN9LKKanGLQ+A@mail.gmail.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: news.uni-berlin.de eM/TXGUvHp5svt5CZcWMhgnw2nSZ77r/B7TxNGdyKdSw==
Return-Path: <rosuav@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=YFMawHuc;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'looks': 0.02; 'this:':
0.03; '2022': 0.05; 'mar': 0.07; 'string': 0.07; 'subject:API':
0.07; 'string,': 0.09; 'subject:result': 0.09; 'that.': 0.15;
'chrisa': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris
angelico': 0.16; 'pyobject*': 0.16; 'subject:incorrect': 0.16;
'subject:returns': 0.16; 'wrote:': 0.16; 'api': 0.17; 'tue,':
0.19; 'to:addr:python-list': 0.20; 'python-list': 0.32; 'message-
id:@mail.gmail.com': 0.32; 'but': 0.32; 'header:In-Reply-To:1':
0.34; 'received:google.com': 0.34; 'from:addr:gmail.com': 0.35;
'received:209.85': 0.37; 'received:209': 0.39
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=MunLOrrEIIpgsCaSxTsgeFnBJz/jFSRaLP1f+zKEMNI=;
b=YFMawHucCcatT78GofsPawRE696Cbgvxwzq2laKRQPlEBmRrYp7Rfym7XoTJAPRYf8
JyZYbtxwAplbRiioHd/p5obSAaIrB2u9eUR5UMEbZ6NpCk3lXWv9Af+jfQRxYI00/rwK
wjkIk3uYZhsl3l0omAk5vPi91DE6KL+oCp25jITMHjuL1IzJXEPgy5W6Mbzk+NzsMrpH
2rMzMoshvBn/TAqoqfAcRqAj7hmeqzsynEm30sLOQSChS0nvaEo8V0Is+G4wCtWteV9M
xfCe3zbp1XzEMmjPZz2SKbTG+yrlDhPOAU5AcUTn5Y0vqJlMCnuEFpEAnlY9FmExDvZM
BgDQ==
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=MunLOrrEIIpgsCaSxTsgeFnBJz/jFSRaLP1f+zKEMNI=;
b=RxtkpMlAUycYIGoVSLvHRz/DvPr6t+u9o10/ZG3zpk01cTPOBZLYIQ2/cGGSZtahgV
EcbjadtZ44m8KbIT2EUmUhQF7jjtd/TgPMqJjuyCYQFSbuJu4Yzgu12oU37YO7akOIqn
kvSVJ3vDsA9xLxw+Yglrp3NnWS2Lij7n52z2lzzBNmR+4t/hz165PvdKfRSqhnv3J2uN
y3/Q0l52pNKJ0YrltQoDSJDqFkfyB6bT0KePWBAxDbtl+xTlswtTy932gc+xUicUaUqV
mD/E+GtCtGXFL+ge0l3xaHLY4kgLNI0ImAQkTPi/5WQ66DlXcoYvOSz/JIR7riTszgAe
8SKw==
X-Gm-Message-State: AOAM530+NBA/C2FcSsltEkOv1pSeKVZsM9cp17kIl5zYyQTuFBNCtj42
U7vJ7ssRMXym8tQeey98Zg6teboByWkpDq7RA75Isk9V
X-Google-Smtp-Source: ABdhPJyLH+etPkPp5NJOpuCr5tK5wRb5QmURPj0Ow/uFahW7/TsQ0d1Acd0H5/IRQR2s+LGXiBIiwfU/HfXlKk3ZH68=
X-Received: by 2002:adf:db43:0:b0:1ef:7195:43cd with SMTP id
f3-20020adfdb43000000b001ef719543cdmr9115579wrj.495.1646672988071; Mon, 07
Mar 2022 09:09:48 -0800 (PST)
In-Reply-To: <Mx_KxMD--3-2@tutanota.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: <CAPTjJmrcOZVwB0g+aScJ7V8svx1_iW-jeOsNUdN9LKKanGLQ+A@mail.gmail.com>
X-Mailman-Original-References: <MxWmaxK--3-2@tutanota.com>
<5ad962fc-1257-dd8d-96ab-541ae5bae2fa@mrabarnett.plus.com>
<Mx_KxMD--3-2@tutanota.com>
 by: Chris Angelico - Mon, 7 Mar 2022 17:09 UTC

On Tue, 8 Mar 2022 at 04:06, Jen Kris via Python-list
<python-list@python.org> wrote:
> But with the C API it looks like this:
>
> PyObject *pSentence = PySequence_GetItem(pSents, sent_count);
> PyObject* str_sentence = PyObject_Str(pSentence); // Convert to string
>
> PyObject* repr_str = PyObject_Repr(str_sentence);

You convert it to a string, then take the representation of that. Is
that what you intended?

ChrisA

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor