Message363834
I plan to merge my PR 17340 at the end of week to not miss Python 3.9 feature freeze deadline, unless someone speaks up and find a good reason to not merge this PR. The PR adds a public C API PyInterpreterState_SetEvalFrameFunc() and now pass tstate to the frame evaluation function.
--
Mark Shannon is against the idea of providing a way to set the frame evaluation function (PEP 523), but Dino Viehland, Eric Snow, Brett Cannon and me want to provide a C API for that.
--
I propose to properly fix this issue in Python 3.9:
* Add a public C API to get and set the frame evaluation function
* Pass tstate to this frame evaluation function
Pass tstate is a backward incompatible change. But it's unclear to me if its API was part of the "public" C API in Python 3.7. In Python 3.8, PyInterpreterState structure moved to the internal C API which is clearly excluded from backward compatibility warranties of the public C API.
Anyway, I expect that they are less than 10 projects in the world which use the frame evaluation function, which it should be doable to update all of them to support the C API for Python 3.9 that I'm proposing.
--
> This is no longer possible because in 3.8 the PyInterpreterState is opaque, so, Py_BUILD_CORE_MODULE needs to be defined defined and "internal/pycore_pystate.h" must be included to set PyInterpreterState.eval_frame.
The status quo is that Python 3.8.0, 3.8.1 and 3.8.2 have been released with that. If someone wants to support "Python 3.8", using Py_BUILD_CORE_MODULE to access the internal C API is the way to go. If we wanted to add a public C API in Python 3.8, IMHO we had to do it *before Python 3.8.0 release. Now it's way too late. |
|
Date |
User |
Action |
Args |
2020-03-10 17:45:43 | vstinner | set | recipients:
+ vstinner, brett.cannon, gregory.p.smith, fabioz, phsilva, dino.viehland, lukasz.langa, Mark.Shannon, eric.snow |
2020-03-10 17:45:43 | vstinner | set | messageid: <1583862343.19.0.142588084948.issue38500@roundup.psfhosted.org> |
2020-03-10 17:45:43 | vstinner | link | issue38500 messages |
2020-03-10 17:45:42 | vstinner | create | |
|