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

Barry barry at barrys-emacs.org
Fri Jul 29 17:22:55 EDT 2022



> On 29 Jul 2022, at 19:33, Marco Sulla <Marco.Sulla.Python at 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.

Barry


> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 



More information about the Python-list mailing list