[Python-Dev] Pymalloc and backward compatibility (original) (raw)

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


Neil Schemenauer wrote:

You can use a macro like this:

#if PYVERSIONHEX < 0x01060000 #define PyObjectNew PyObjectNEW #define PyObjectDel PyMemDEL #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.

Neil