[Python-Dev] Pymalloc and backward compatibility

Neil Schemenauer nas@python.ca
Thu, 4 Apr 2002 07:25:06 -0800

Neil Schemenauer wrote:
> You can use a macro like this:
>     #if PY_VERSION_HEX < 0x01060000
>     #define PyObject_New PyObject_NEW
>     #define PyObject_Del PyMem_DEL
>     #endif

I just realized that this may be unclear.  You don't _need_ to use the
above macro to make your code work across versions.  As long as you use
PyMem_DEL and not free() to deallocate objects the code will work.