ctypes is not a great way of wrapping a C library either, since it doesn't give you access to the header files, which you need to use if you want portability.
Redefining all the structs/#defines/etc manually in ctypes is a great way to make a completely unportable library wrapper.
Posted May 16, 2011 18:54 UTC (Mon) by njs (guest, #40338)
[Link]
Yeah, it works well for some simpler cases, but that's why I use cython :-).
(Actually, I think most of the times I've used ctypes were to commit horrors by poking at the innards of the interpreter -- casting id(myobj) to a pointer and then screwing with C-level fields. It's not easy to guarantee portability between different implementations of a language!)