This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients brett.cannon, eric.snow, larry, ncoghlan, random832, rhettinger, serhiy.storchaka, vstinner, xiang.zhang
Date 2016-04-21.07:59:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1461225548.05.0.718938181579.issue26811@psf.upfronthosting.co.za>
In-reply-to
Content
> Maybe a new C function can be designed to call a function: it would uses PyEval_EvalCodeEx() to call functions implemented in Python, or create the tuple for functions implemented in C.

I would expect C code to be more optimized that Python functions, but for the specific case of function calls: Python are more optimized with the fast-path fast_function()!

I recall vaguely that Larry Hasting shared me his idea of passing the Python stack to C functions to avoid the creation of a tuple.

Maybe we can add a new API for C functions accepted a C array of PyObject*, a number of positional arguments and a number of (key, value) pairs for keyword arguments. Something similar to PyEval_EvalCodeEx() but for C functions. It means that we should add a new flavor of PyArg_ParseTuple/PyArg_ParseTupleAndKeywords to accepts this format.

Larry's idea was to use the argument clinic to handle that for us.
History
Date User Action Args
2016-04-21 07:59:08vstinnersetrecipients: + vstinner, brett.cannon, rhettinger, ncoghlan, larry, eric.snow, serhiy.storchaka, random832, xiang.zhang
2016-04-21 07:59:08vstinnersetmessageid: <1461225548.05.0.718938181579.issue26811@psf.upfronthosting.co.za>
2016-04-21 07:59:08vstinnerlinkissue26811 messages
2016-04-21 07:59:07vstinnercreate