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

2015-11-28 Thread Oscar Benjamin
On 28 Nov 2015 12:06, "James Oren" wrote: > > Hi all, this is my first time using the mailing list. > > I'm trying to learn how to use C to extend my code, and have already worked > out how to use ctypes. I'm now trying to learn the full C extension module > approach with Python.h and have worked

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

2015-11-28 Thread Alan Gauld
On 28/11/15 15:59, Laura Creighton wrote: >> effort than ctypes to call a library function? I can't see any advantage, >> so what am I missing? > > Ctypes is slow. Aha. Performance is always the invisible feature. I only ever use ctypes to access OS features that don't have a Python equivalent

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

2015-11-28 Thread Laura Creighton
In a message of Sat, 28 Nov 2015 12:46:11 +, 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 c

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

2015-11-28 Thread Alan Gauld
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 m

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

2015-11-28 Thread Laura Creighton
In a message of Sat, 28 Nov 2015 12:22:12 +, Alan Gauld writes: >On 28/11/15 06:04, James Oren wrote: > >> I'm trying to learn how to use C to extend my code, and have already worked >> out how to use ctypes. I'm now trying to learn the full C extension module >> approach with Python.h and have

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

2015-11-28 Thread Laura Creighton
In a message of Sat, 28 Nov 2015 12:22:12 +, Alan Gauld writes: >On 28/11/15 06:04, James Oren wrote: > >> I'm trying to learn how to use C to extend my code, and have already worked >> out how to use ctypes. I'm now trying to learn the full C extension module >> approach with Python.h and have

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

2015-11-28 Thread Alan Gauld
On 28/11/15 06:04, James Oren wrote: > I'm trying to learn how to use C to extend my code, and have already worked > out how to use ctypes. I'm now trying to learn the full C extension module > approach with Python.h and have worked through the Python doc and a couple > other examples. OK, This

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

2015-11-28 Thread James Oren
Hi all, this is my first time using the mailing list. I'm trying to learn how to use C to extend my code, and have already worked out how to use ctypes. I'm now trying to learn the full C extension module approach with Python.h and have worked through the Python doc and a couple other examples. Th