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

Guido van Rossum guido@python.org
Mon, 01 Apr 2002 10:33:08 -0500

> Guido van Rossum wrote:
> > No, it's for the binary API.  There's a test in Py_InitModule() that
> > checks whether a dynamically loaded extension uses the same API as the
> > core, and that's definitely a binary compatibility issue.
> I was under the impression that the binary API changes in every minor
> release.

The API version number doesn't always.  Maybe we're going about this
wrong though: when we only *add* to the API, we don't change the API
version number, on the theory that extensions that worked before still
work.  But of course extensions that use the added API functions won't
work on the older systems, despite having the same API number.
(However, they will get a different kind of error, from the linker.)

I think I try to change the API version number when there are
incompatible changes in object lay-out which would trip you up even if
the functions haven't changed.  An example would be adding the hash
field to the string object, which requires recompilation for every
extension that uses the PyString_AS_STRING macro.  (This happened many
years ago of course.)

--Guido van Rossum (home page: http://www.python.org/~guido/)