On 18.03.2021 11:36, Simon Cross wrote:
On Wed, Mar 17, 2021 at 8:27 PM M.-A. Lemburg <mal@egenix.com> wrote:
Even with tools like Cython you still need the C API.
Agreed, although a layer of indirection can be helpful when making changes. For example, for HPy we are hoping to write an HPy backend for Cython at some point which generates C code that uses the HPy API instead of the existing C API. That is decidedly non-zero work, but will potentially port a large chunk of the C extension ecosystem in one go (with a fair bit of mopping up required, I'm sure).
True, but HPy is a different target anyway, so it will require changes to the extensions one way or another and using Cython is a good way to prepare for supporting it.
Still, code which already uses the Python C API directly and works perfectly now should not require a rewrite just to work on an upcoming regular Python release which ships with an optional new extension mechanism (subinterpreters in this case).
We have to find better ways of accomplishing such changes, e.g. by introducing shims, compatibility layers, tools which make the transition seamless (and way more capable than lib2to3), etc.
No one wants another Python 2 to 3 hiatus.
-- Marc-Andre Lemburg eGenix.com
Professional Python Services directly from the Experts (#1, Mar 18 2021)
Python Projects, Coaching and Support ... https://www.egenix.com/ Python Product Development ... https://consulting.egenix.com/
::: We implement business ideas - efficiently in both time and costs :::
eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 https://www.egenix.com/company/contact/ https://www.malemburg.com/