[Python-Dev] [Python-3000] PyString -> PyBytes C API renaming (Stabilizing the C API of 2.6 and 3.0)
Nick Coghlan
ncoghlan at gmail.com
Wed May 28 15:43:13 CEST 2008
M.-A. Lemburg wrote:
> You are probably talking about the great renaming between 1.4 and 1.5.
> That was different, since it changes almost all C APIs in Python.
> And it used the standard practice... from rename2.h in Python 1.5:
>
> /* This file contains a bunch of #defines that make it possible to use
> "old style" names (e.g. object) with the new style Python source
> distribution. */
>
> #define True Py_True
> #define False Py_False
> #define None Py_None
>
> ie. #define <oldname> <newname>
This is what I expected to see in stringobject.h, along with some code
in stringobject.c to allow the linker to see the old names *as well as*
the new names.
At the moment, all the code appears to be using the new names, but
stringobject.h implicitly converts the new names back to the old names -
so trying to use ctypes to retrieve the PyBytes_* functions from the
Python DLL will fail.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
More information about the Python-Dev
mailing list