Interfacing a dynamic shared library gives me different results in 2.7 versus 3.5

Chris Angelico rosuav at gmail.com
Tue May 24 12:45:30 EDT 2016


On Wed, May 25, 2016 at 2:32 AM, Steven D'Aprano <steve at pearwood.info> wrote:
> On Wed, 25 May 2016 02:18 am, Siyi Deng wrote:
>
>> Hello ChrisA,
>> I don't quite understand, the binary shared library contains no python
>> interfaces, it should be independent of python.
>
> In your first post, you said you were using numpy. How is that independent
> of Python?

I'm not certain of the in-memory representation of a numpy array, but
it wouldn't surprise me if it's just a series of consecutive
ints/floats - which would be exactly what a C or Fortran library will
be expecting. So my understanding is that there's some basic ctypes
wrapper code to locate the base address of the array, and then it
passes that straight along.

Of course, without seeing the code....

ChrisA



More information about the Python-list mailing list