cython/cython — pull request #113 by andreasvc (2012-04-22 16:47:47+00:00)
Title: Python array support

Adapted from patch at http://trac.cython.org/cython_trac/ticket/314

Changes: reverted Py_MEM_Realloc to Py_Mem_Resize, due to warnings
removed inline keyword (not portable, and Py_LOCAL_INLINE causes warnings).
moved a C declaration to top of function to avoid "mixed declaration"

Python array objects are useful because there is no dependency like with numpy, they make sense for small 1D-arrays. With this patch you can have C-level access to Python arrays, while still having the convenience of Python taking care of garbage collection. Another advantage is that they can be pickled, so you can pass them around to other processes with multiprocessing.

I didn't really succeed in getting the tests to compile, unfortunately. But if I place these files in the directory of a project it works fine. Another thing is that I'd like to get rid of all warnings; there's still a gcc warning about __getbuffer__ being declared but not used.