[Python-Dev] C-API status of Python 3?

Stefan Behnel stefan_ml at behnel.de
Sun Mar 2 06:44:47 CET 2008

Christian Heimes wrote:
> Stefan Behnel wrote:
>> I would like to know how stable the C-API of Python 3 is, or what the expected
>> release level (beta?) would be at which I can expect it to stabilise. What is
>> the plan here?

The release schedule in PEP 3000 says "August 2008" for 3.0 final, is that
still the current goal? Can I expect the C-API to stabilise by June, then?
That's where we are planning a Cython workshop with a couple of sprints. Py3k
support might be worth targeting - if we can rely on a fixed target by then.

>> The background is Cython, which will need to support Python 3 one day or
>> another, so I wanted to know from which point on it will make sense to start
>> thinking about a migration plan.
> The 3.0 API isn't stable yet. I plan to rename some of the functions
> before the first beta is released. Currently the naming schema is too
> confusing:
> PyUnicode - str
> PyString - bytes
> PyBytes - bytearray
> See? :)

I see. :)

I actually expect the string semantics to be amongst the harder changes (at
least, it's the most visible from a C-API point of view).

However, names are not a big problem if you generate code anyway. Behaviour is
what matters most for Cython. And we're already trying to adapt Cython's
syntax to Py3k's, although that's not a requirement in all cases, as Cython
lives with a couple of differences already. Keeping old syntax around and
mapping it to the new C-API makes it easier to migrate existing Cython code.

Hmmm, I even guess that the biggest problem might be porting Cython itself...

> The documentation for the PyString functions is outdated and IIRC the
> PyBytes docs are non existing.

Ok, so I guess it would at least be a good idea to wait for the docs to be
fixed, then.


More information about the Python-Dev mailing list