[Python-Dev] Moving forward on the object memory API

Martin v. Loewis martin@v.loewis.de
01 Apr 2002 00:36:05 +0200


Neil Schemenauer <nas@python.ca> writes:

> > > We deprecate the PyMem_* functions.  There's no need for them, IMHO:
> > 
> > -1. The rationale behind the function spellings is, as Tim explains,
> > cross-version compatibility. 
> 
> What kind of cross-version compatibility are you referring to?

If you use the macro version, you binary module will break if the
internals of the macro change across Python versions. If you use the
function version, the module will continue to work even if the
internals change.

For example, a module compiled for Python 2.3, compiled on an
installation that uses pymalloc, can be used even on an installation
that has pymalloc disabled, if it only uses the function versions.
The same is not guaranteed if uses the macro versions.

Regards,
Martin