[Pyrex] externs for python base types

David McNab rebirth at orcon.net.nz
Wed Nov 7 23:03:03 CET 2007


On Wed, 2007-11-07 at 12:55 -0800, Robert Bradshaw wrote:
> Cython comes bundled with a list of such files. See
> 
> http://cython.org/hg/cython-package/file/82c24a21bc9a/Includes/

Wow - that's an excellent start. Beers all round to the Cython devs.

> Of course, more could be done with this.

Guess so. One great thing to add would be the respective object
internals declarations to each of the base types' header files.

For instance, python_list.pxi has all the Python C API funcs for working
with lists, but it doesn't have the list internals structs sufficient to
help one create an extension type subclassed from list - compare
discussion of subclassing from complex, at
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/version/Doc/Manual/extension_types.html#ExternalExtTypes

Cheers
David

> - Robert
> 
> On Nov 7, 2007, at 12:28 PM, David McNab wrote:
> 
> > Hi,
> >
> > Does anyone have a .pxi header or a .pyx file containing 'cdef extern
> > from' blocks for python base types, such as list, tuple, str etc?
> >
> > I want to create (amongst other things) a Pyrex extension type
> > subclassing from 'list'.
> >
> > While I'm on the subject, has there been any further thought about
> > standardising a header collection for Pyrex/Cython distros? I'm still
> > not completely happy with the idea of everyone having to roll their  
> > own
> > headers.
> >
> > IMHO, the ideal would be for Pyrex to have a hardwired default .pxi
> > header search path, such as:
> >   ['.', '~/.pyrex/include', '/usr/share/pyrex/include']
> >
> >
> > Cheers
> > David
> >
> >
> >
> >
> > _______________________________________________
> > Pyrex mailing list
> > Pyrex at lists.copyleft.no
> > http://lists.copyleft.no/mailman/listinfo/pyrex
> 
> 




More information about the Pyrex mailing list