[SciPy-Dev] Multivariate ctypes integration PR

Nathan Woods charlesnwoods at gmail.com
Mon Mar 31 15:27:12 EDT 2014


We had a question about how to implement one of the suggested improvements:

"- The code should more carefully check that the whole ctypes signature
  matches"

>From what we can tell (see e.g.
http://stackoverflow.com/questions/18775389/is-there-a-way-to-load-the-constant-values-stored-in-a-header-file-via-ctypes),
there is no way to automatically generate the ctypes function signature
directly from a .h header file or c function prototype. This means that any
ctypes library function must be assumed to have the function signature that
the user claims it does (by specifying argtypes & restype). Unfortunately,
the ctypes library load & specification commands are executed by the user,
not by the library, so there's no way to enforce the function signature.

Maybe there's a way in Cython or f2py, but we think that ctypes should
probably be supported anyway, even if it is with an "use at own risk"
disclaimer.

Nathan



On Fri, Mar 14, 2014 at 12:08 PM, Brian Lee Newsom <
Brian.Newsom at colorado.edu> wrote:

> Thank you to everyone involved in assisting to move this forward. It is
> definitely a confusing project for me but something I am committed to
> finishing and getting in the library as soon as possible.  I appreciate the
> help and I will do my best to address the issues Pauli presented.
>
> Thanks,
> Brian
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20140331/4fc480d5/attachment.html>


More information about the SciPy-Dev mailing list