Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SWIG generator of PEP-484 type hint stub files #220

Closed
mcepl opened this issue May 15, 2016 · 7 comments
Closed

SWIG generator of PEP-484 type hint stub files #220

mcepl opened this issue May 15, 2016 · 7 comments

Comments

@mcepl
Copy link

mcepl commented May 15, 2016

I know this is probably wrong place to ask, so I am expecting to be redirected somewhere else, but it would be awfully nice to have a tool, which would be able to generate *.pyi files for the Python bindings generated by SWIG.

@gvanrossum
Copy link
Member

You'd have to open a SWIG feature request. (Or contribute one yourself.)

This is a special case though of something we are keeping track of here: python/mypy#1240 -- for example we've actually got a use case for a similar thing for Protocol Buffers (protobuf).

@mcepl
Copy link
Author

mcepl commented May 15, 2016

I have asked for it on the SWIG list already (http://thread.gmane.org/gmane.comp.programming.swig/21112), but I just thought that you may be able to push from the other side as well ;).

@gvanrossum
Copy link
Member

gvanrossum commented May 15, 2016 via email

@mcepl
Copy link
Author

mcepl commented May 15, 2016

Not sure what you mean as SWIG output. Generated C code? binary module? stubgen from 0.4.1 doesn't seem to react to either of these
_m2crypto_wrap.c.txt (yes, that's M2Crypto)

@gvanrossum
Copy link
Member

Oh, sorry. Doesn't it generate Python glue? If it's just generating C, it
looks like stubgen it supposed to handle those, IIUC by importing them and
then introspecting the module dict. I've not tried this myself though.

@mcepl
Copy link
Author

mcepl commented May 16, 2016

It doesn't. It basically generates the C code (see attached) which compiles to Python-compatible binary module. Anyway, I will continue to pursue this on the Swig list.

@mcepl mcepl closed this as completed May 16, 2016
@mcepl
Copy link
Author

mcepl commented Jun 9, 2024

Just for the record, there is swig/swig#735

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants