[Python-3000] how should we handle changes to the C API?

Guido van Rossum guido at python.org
Sun Feb 11 07:26:28 CET 2007


On 1/29/07, Brett Cannon <brett at python.org> wrote:
> I was more generally wondering what the plan was for transitioning any
> C API changes (if we were even going to do that level of transition).

It's too early for much of a plan IMO. I'm not making radical changes
(yet) but I'm mercilessly deleting APIs as they become obsolete. I
expect that we need to wait until we've implemented the new I/O
library and the str/unicode unification before we can say much about
what to do about C APIs.

But there's one thing we can do: not change existing APIs in
incompatible ways. If you delete an API, code that uses it gets a
compile-time error, and that should make it relatively simple to fix
(assuming there's a replacement). But if you change the signature it's
more questionable, and if you change the semantics (e.g. returning a
different kind of PyObject*) it's painful.

So let's commit to not changing signatures or semantics, but delete
obsolete APIs in favor of new ones (with a different name). I guess
this means some of the new names will be ugly. So what, it's C. :-)

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


More information about the Python-3000 mailing list