Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

The only thing necessary for the triumph of evil is for good men to do nothing. -- Edmund Burke


devel / comp.lang.python / Re: How to generate a .pyi file for a C Extension using stubgen

SubjectAuthor
o Re: How to generate a .pyi file for a C Extension using stubgenBarry

1
Re: How to generate a .pyi file for a C Extension using stubgen

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

  copy mid

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

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: barry@barrys-emacs.org (Barry)
Newsgroups: comp.lang.python
Subject: Re: How to generate a .pyi file for a C Extension using stubgen
Date: Sat, 30 Jul 2022 14:59:14 +0100
Lines: 45
Message-ID: <mailman.145.1659189564.20444.python-list@python.org>
References: <CABbU2U8W4js+tL_hFHpSVhDAm0R4zyLYkbkiscVj14RpdqBjSg@mail.gmail.com>
<95C1FCDD-29FA-4CEA-9C47-419686A330AB@barrys-emacs.org>
Mime-Version: 1.0 (1.0)
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de 7ykiY9YDyQI3WzUt83bmywFqdkTSsua+ZbJxHtOHVoHA==
Return-Path: <barry@barrys-emacs.org>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'jul': 0.04; '2022': 0.05;
'files)': 0.07; 'modules': 0.07; 'cc:addr:python-list': 0.09;
'from:addr:barry': 0.09; 'received:217.70': 0.09;
'received:gandi.net': 0.09; 'received:mail.gandi.net': 0.09;
'url:stable': 0.09; '.py': 0.16; '2022,': 0.16; '>>>>': 0.16;
'barry': 0.16; 'cc:name:python list': 0.16; 'from:addr:barrys-
emacs.org': 0.16; 'generates': 0.16; 'message-id:@barrys-
emacs.org': 0.16; 'says:': 0.16; 'splitting': 0.16; 'wrote:':
0.16; 'python': 0.16; 'says': 0.17; 'code.': 0.17; 'figure': 0.19;
'cc:addr:python.org': 0.20; 'fri,': 0.22; 'instructions': 0.22;
'subject:file': 0.22; 'subject:How': 0.23; 'subject:using': 0.23;
'extension': 0.25; 'cannot': 0.25; 'cc:2**0': 0.25; 'tried': 0.26;
'creating': 0.27; '>>>': 0.28; 'but': 0.32; 'subject:for': 0.33;
'there': 0.33; 'work.': 0.34; 'header:In-Reply-To:1': 0.34; 'url-
ip:104.17/16': 0.35; 'files': 0.36; 'file': 0.38; 'could': 0.38;
'enough': 0.39; 'use': 0.39; 'files.': 0.40; 'follow': 0.62;
'ever': 0.63; 'your': 0.64; 'tool': 0.65; 'received:217': 0.67;
'away': 0.67; 'little': 0.73; 'luck.': 0.84; 'sulla': 0.84
In-Reply-To: <CABbU2U8W4js+tL_hFHpSVhDAm0R4zyLYkbkiscVj14RpdqBjSg@mail.gmail.com>
X-Mailer: iPad Mail (19G71)
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: <95C1FCDD-29FA-4CEA-9C47-419686A330AB@barrys-emacs.org>
X-Mailman-Original-References: <CABbU2U8W4js+tL_hFHpSVhDAm0R4zyLYkbkiscVj14RpdqBjSg@mail.gmail.com>
 by: Barry - Sat, 30 Jul 2022 13:59 UTC

> On 30 Jul 2022, at 10:30, Marco Sulla <Marco.Sulla.Python@gmail.com> wrote:
>
> On Fri, 29 Jul 2022 at 23:23, Barry <barry@barrys-emacs.org> wrote:
>>
>>
>>
>>>> On 29 Jul 2022, at 19:33, Marco Sulla <Marco.Sulla.Python@gmail.com> wrote:
>>>
>>> I tried to follow the instructions here:
>>>
>>> https://mypy.readthedocs.io/en/stable/stubgen.html
>>>
>>> but the instructions about creating a stub for a C Extension are a little
>>> mysterious. I tried to use it on the .so file without luck.
>>
>> It says that stubgen works on .py files not .so files.
>> You will need to write the .pyi for your .so manually.
>>
>> The docs could do with splitting the need for .pyi for .so
>> away from the stubgen description
>
> But it says:
>
> "Mypy includes the stubgen tool that can automatically generate stub
> files (.pyi files) for Python modules and C extension modules."
>
> I tried stubgen -m modulename, but it generates very little code.

Oh…

From the .so I am struggling to figure out how it could ever work reliably..
I cannot see that there is enough information in a useful form to allow
the tool to work.

Barry

>


devel / comp.lang.python / Re: How to generate a .pyi file for a C Extension using stubgen

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor