bpo-37151: remove special case for PyCFunction from PyObject_Call#14684
bpo-37151: remove special case for PyCFunction from PyObject_Call#14684encukou merged 3 commits into
Conversation
567d118 to
e0f6c09
Compare
July 10, 2019 14:46
Sorry, something went wrong.
That's the kind of function that projects like Cython call directly. |
Sorry, something went wrong.
What point are you trying to make? It that just a comment or is it saying something about this PR? Or are you just complaining about Cython? Or is it a joke somehow? |
Sorry, something went wrong.
|
I suggest to ensure that any PyCFunction_Call behavior change will not break anything, especially in Cython. |
Sorry, something went wrong.
|
It is undocumented, so the only documentation available to people who wanted to use this function was the code itself. Perhaps CPython could use |
Sorry, something went wrong.
|
I checked and Cython doesn't use |
Sorry, something went wrong.
At that point, probably best would be to just alias it to |
Sorry, something went wrong.
|
Right, it's quite useless as public API. Remove it in 3.9. But:
It was probably never intended to be public (and probably predates discussions on what should be public), but it is an exported symbol. |
Sorry, something went wrong.
|
We need to keep it for the stable ABI, but that's easily solved by making it an alias of I updated my branch to do this. |
Sorry, something went wrong.
|
Added a deprecation for |
Sorry, something went wrong.
encukou
left a comment
There was a problem hiding this comment.
Thanks. I'm now comfortable merging this, especially since it's for 3.9.
Sorry, something went wrong.
…thonGH-14684) bpo-37151: remove special case for PyCFunction from PyObject_Call Alse, make the undocumented function PyCFunction_Call an alias of PyObject_Call and deprecate it.
The function
PyObject_Callcontains a special case for calling instances ofPyCFunctionwithMETH_VARARGS. This is to avoid a double recursion check:cfunction_call_varargsalready callsPy_EnterRecursiveCall, soPyObject_Callshould not. We can simplify this by removing the recursion check fromcfunction_call_varargsand removing the special case fromPyObject_Call.In addition, we fold
cfunction_call_varargsintoPyCFunction_Calland move it back toObjects/methodobject.cwhich already contains the vectorcall functions ofPyCFunction.https://bugs.python.org/issue37151