[Python-Dev] Ctypes and the stdlib (was Re: LZMA compression support in 3.3)

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Aug 29 23:17:24 CEST 2011


Guido van Rossum wrote:
> (Just like Python's own .h files --
> e.g. the extensive renaming of the Unicode APIs depending on
> narrow/wide build) How does Cython deal with these?

Pyrex/Cython deal with it by generating C code that includes
the relevant headers, so the C compiler expands all the
macros, interprets the struct declarations, etc. All you
need to do when writing the .pyx file is follow the same
API that you would if you were writing C code to use the
library.

-- 
Greg


More information about the Python-Dev mailing list