Re: [Python-Dev] New calling convention to avoid temporarily tuples when calling functions

2016年8月24日 15:56:30 -0700

2016年08月22日 10:01 GMT+02:00 Victor Stinner <[email protected]>:
> The next step is to support keyword parameters. In fact, it's already
> supported in all cases except of Python functions:
> https://bugs.python.org/issue27809 
Serhiy Storchaka proposed to use a single C array for positional and
keyword arguments. Keyword arguments are passed as (key, value) pairs.
I just added this function:
 PyAPI_FUNC(PyObject *) _PyObject_FastCallKeywords(
 PyObject *func,
 PyObject **stack,
 Py_ssize_t nargs,
 Py_ssize_t nkwargs);
The function is not used yet. Serhiy proposed to enhance the functions
to parse arguments to support this format to pass arguments which
would allow to avoid the creation of a temporary dictionary in many
cases.
I proposed to use this format (instead of (PyObject **stack,
Py_ssize_t nargs, PyObject *kwargs)) for a new METH_FASTCALL calling
convention for C functions:
https://bugs.python.org/issue27810
Victor
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to