[Tutor] Help with returning a list object from a C extension.

Laura Creighton lac at openend.se
Sat Nov 28 10:59:35 EST 2015


In a message of Sat, 28 Nov 2015 12:46:11 +0000, Alan Gauld writes:
>On 28/11/15 12:29, Laura Creighton wrote:
>> Most people I know have abandoned ctypes. They are using cffi instead. 
>
>Really? Why?
>I'd never heard of cffi before, but looking at the docs it seems like a
>lot more
>effort than ctypes to call a library function? I can't see any advantage,
>so what am I missing?
>
>-- 
>Alan G

Ctypes is slow.  It's fine to get simple things running, but if the
object of the exercise was to get speed in the first place you are
better off with Cython, if you are writing the thing yourself, or
cffi if you are wrapping an existing C library.

Laura


More information about the Tutor mailing list