Moore, Paul wrote: > I've been watching the pymalloc discussions going on recently, and I'm > concerned that there may be some fairly major compatibility changes > coming. We are trying to avoid that. > The code has survived essentially unchanged through [Python 1.4] to > Python 2.2, and still works fine. This is a great test case. Can you provide a URL to the code? > It seems to me that there are two options open for me: > > 1. The Python API from 1.4 is still guaranteed to work unchanged (even given > the liberties mentioned above). In that case, do nothing. > 2. There are changes required. In that case, make them, protected by python > API checks (annoying ifdef fun). As long as you don't use free() to deallocate objects then you are safe. Python 1.4 has PyMem_DEL. You can use a macro like this: #if PY_VERSION_HEX < 0x01060000 #define PyObject_New PyObject_NEW #define PyObject_Del PyMem_DEL #endif and use PyObject_New and PyObject_Del to manage object memory. Neil
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4