[Pyrex] Question, plus suggestions for improvement?

Stefan Behnel behnel_ml at gkec.informatik.tu-darmstadt.de
Tue Aug 1 20:20:50 UTC 2006



Bill Mill wrote:
> 1) I see very few native C operations in the source code, just
> eyeballing it. How could I restructure my code to bring more in?
> 
> 2) Could I make list access faster? Optionally convert the list into
> an array of (integers, characters, strings, etc) by a user's argument?

Use something like this to access Python's C API directly:

http://codespeak.net/svn/lxml/trunk/src/lxml/python.pxd

For example, if you know it's a list, use PyList_GetItem or even
PyList_GET_ITEM. Pyrex can't use them as it doesn't know it's always accessing
a list.

Stefan



More information about the Pyrex mailing list