IMPORTANT 2.5 API changes for C Extension Modules

Fredrik Lundh fredrik at pythonware.com
Thu Apr 6 06:49:42 EDT 2006


konrad.hinsen at laposte.net wrote:

> One question: Is there a safe way to keep extension modules backward-
> compatible with older Python versions?

absolutely.

> I am thinking of something like
>
> #ifndef PY_SSIZE_T_DEFINED
> typedef Py_ssize_t int;
> #endif
>
> assuming that Python 2.5 defines PY_SSIZE_T_DEFINED.

the "official" way to do this is described in the conversion guidelines:

    http://www.python.org/dev/peps/pep-0353/#conversion-guidelines

</F>






More information about the Python-list mailing list