Python Questions - July 25, 2015

BartC bc at
Wed Jul 29 18:50:37 CEST 2015

On 29/07/2015 17:13, Laura Creighton wrote:
> In a message of Tue, 28 Jul 2015 17:45:00 +0100, BartC writes:
>> On 28/07/2015 17:12, Steven D'Aprano wrote:

>> Yes, I know (I was looking at it myself a few days ago for another
>> project). But while it might be used for implementing some of Python's
>> internals, I was wondering what it was doing in a user-level set of
>> libraries, given that it's mostly a bunch of C code.
>> Perhaps they were just padding the list to make it look more impressive.
> People who use numpy also want to load up their c extensions a
> whole lot.  If you have a hunk of C code (a library, ususually) and
> you want to call it from your python code, and play with its
> objects just like they were python objects, this is one of the
> most common ways to do this.

If it's in the form where you start by writing along the lines of:

  import libffi

then it must be something very different to what I looked at. (Which 
seemed to consists of lots of C files, headers and ASM modules, for 
dozens of different targets and compilers.)

I would also expect a foreign-function interface to be built-in, or to 
have all the details taken care of by an add-on, so that the very low 
level libffi wouldn't figure at all.


More information about the Python-list mailing list