[Python-Dev] Python 2.3 release schedule

Tim Peters tim.one@comcast.net
Mon, 27 May 2002 17:01:23 -0400


[Michael Hudson]
> Surprise of the day: this [is all that's required!]:
>
> #if PY_VERSION_HEX < 0x01060000
> /* raw memory interface already present */
>
> /* there is no object memory interface in 1.5.2 */
> #define PyObject_Malloc(size) PyMem_Malloc((size))
> #define PyObject_Realloc(p, size) PyMem_Realloc((p), (size))
> ...

How come not the simpler

#define PyObject_Malloc		PyMem_Malloc
#define PyObject_Realloc	PyMem_Realloc

etc instead?  Filling in an argument list prevents use of a name as a
function designator.

> ...
> /* There are three "families" of memory API: the "raw memory", "object
>    memory" and "object" families.
>
>    Raw Memory:
>
>        PyMem_Malloc, PyMem_Realloc, PyMem_Free
>
>    Object Memory:
>
>        PyObject_Malloc, PyObject_Realloc, PyObject_Free
>
>    Object:
>
>        PyObject_New, PyObject_NewVar, PyObject_Del

I rarely mention the PyObject_GC_XYZ family because it's already in good
shape.  But its API changed between 2.1 and 2.2, and it would be good to
supply a compatibility layer for it too.  Pick Neil's brain <wink>.

> ...
> Comments, flames, etc appreciated.

I especially liked the (snipped) to-the-point comment blocks; PyObject_Del
problems were already mentioned; thank you!