[issue27810] Add METH_FASTCALL: new calling convention for C functions
STINNER Victor
report at bugs.python.org
Mon Aug 22 04:06:46 EDT 2016
STINNER Victor added the comment:
> There is a tiny bit of a backwards compatibility concern as the new function signature would be incompatible with anything we had before,
Right. If you call directly PyCFunction functions, you will likely get quickly a crash. But... who call directly PyCFunction functions? Why not using the 30+ functions to call functions?
Hopefully, it's easy to support METH_FASTCALL in an existing function getting a tuple:
int nargs = (int)PyTuple_GET_SIZE(args);
PyObject **stack = &PyTuple_GETITEM(args, 0);
result = func(self, stack, nargs, kwargs);
I guess that Cython calls directly PyCFunction. cpyext module of PyPy probably too. Ok, except of them, are you aware of other projects doing that?
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27810>
_______________________________________
More information about the Python-bugs-list
mailing list