Python 3.13 alpha 1 contains breaking changes, what's the plan?

Following the announced plan, I reverted 50 private APIs which were removed in Python 3.13 alpha1. These APIs will be available again in the incoming Python 3.13 alpha2 (scheduled next Tuesday).

I planned to make Cython, numpy and cffi compatible with Python 3.13 alpha1. Well, I missed this release. With reverted changes, numpy 1.26.2 can be built successfully, and cffi 1.16.0 just requires a single change. So we should be good (or almost good) for Python 3.13 alpha2.

It’s not the first time that incompatible C API changes affect many C extensions, have to be reverted, C extensions are updated, and then the changes are made again. This method is a practical way to move the C API forward, since it’s hard to check (see/guess) how the C API is used by 3rd party C extensions. More recently, code search was used on most popular PyPI projects. But maybe we need to design a new approach to let developers experiment scheduled incompatible C API changes, changes scheduled in 1, 2 or more Python releases, without affecting everything as soon as the change is made.

This approach based on a version is being discussed at Macro to hide deprecated functions. See also the discussion on my Add again <unistd.h> include in Python.h PR: some people asked to keep the incompatible change. I reverted it anyway, to do it again later with a smoother migration path.

I was overwhelmed last weeks by the quantity of discussions and issues related to Python 3.13 C API changes. Sometimes, the tone was not pleasant. I didn’t expect so many people testing early the Python 3.13 alpha1, and I didn’t expect people to report eagerly issues asking for changes. During the Python 3.12 devcycle, it took months to get Cython (7 months after the alpha1) and numpy (11 months) ready. It seems like for Python 3.13, it will be way quicker! For me, it’s a good sign that the Python community is active, dynamic and provides feedback as soon as possible. It’s great! :heart: Thank you all! :heart:

I’m sorry if some people felt that this C API work was forced on them and their opinion was not taken in account. We heard you and we took your feedback in account. It took me time to adjust my plan according to early received feedback. I expected to have 6 months to work step by step. Well, I had 2 weeks instead :slight_smile:

I don’t expect Python 3.13 alpha2 to be perfect. We may have to revert a few more private API removals. I expect that the number of build errors will be lower and so it will be easier to test Python 3.13 on your favorite projects.

24 Likes