@@ -273,6 +273,13 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
273273 PyObject * * stack ,
274274 Py_ssize_t nargs );
275275
276+ /* Convert keyword arguments from the (stack, kwnames) format to a Python
277+ dictionary.
278+
279+ kwnames must only contains str strings, no subclass, and all keys must
280+ be unique. kwnames is not checked, usually these checks are done before or later
281+ calling _PyStack_AsDict(). For example, _PyArg_ParseStack() raises an
282+ error if a key is not a string. */
276283 PyAPI_FUNC (PyObject * ) _PyStack_AsDict (
277284 PyObject * * values ,
278285 PyObject * kwnames );
@@ -293,36 +300,39 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
293300 PyObject * * kwnames ,
294301 PyObject * func );
295302
296- /* Call the callable object func with the "fast call" calling convention:
297- args is a C array for positional arguments (nargs is the number of
298- positional arguments), kwargs is a dictionary for keyword arguments.
299-
300- If nargs is equal to zero, args can be NULL. kwargs can be NULL.
301- nargs must be greater or equal to zero.
302-
303- Return the result on success. Raise an exception on return NULL on
304- error. */
305- PyAPI_FUNC (PyObject * ) _PyObject_FastCallDict (PyObject * func ,
306- PyObject * * args , Py_ssize_t nargs ,
307- PyObject * kwargs );
308-
309- /* Call the callable object func with the "fast call" calling convention:
310- args is a C array for positional arguments followed by values of
311- keyword arguments. Keys of keyword arguments are stored as a tuple
312- of strings in kwnames. nargs is the number of positional parameters at
313- the beginning of stack. The size of kwnames gives the number of keyword
314- values in the stack after positional arguments.
315-
316- If nargs is equal to zero and there is no keyword argument (kwnames is
317- NULL or its size is zero), args can be NULL.
318-
319- Return the result on success. Raise an exception and return NULL on
320- error. */
321- PyAPI_FUNC (PyObject * ) _PyObject_FastCallKeywords
322- (PyObject * func ,
323- PyObject * * args ,
324- Py_ssize_t nargs ,
325- PyObject * kwnames );
303+ /* Call the callable object func with the "fast call" calling convention:
304+ args is a C array for positional arguments (nargs is the number of
305+ positional arguments), kwargs is a dictionary for keyword arguments.
306+
307+ If nargs is equal to zero, args can be NULL. kwargs can be NULL.
308+ nargs must be greater or equal to zero.
309+
310+ Return the result on success. Raise an exception on return NULL on
311+ error. */
312+ PyAPI_FUNC (PyObject * ) _PyObject_FastCallDict (PyObject * func ,
313+ PyObject * * args , Py_ssize_t nargs ,
314+ PyObject * kwargs );
315+
316+ /* Call the callable object func with the "fast call" calling convention:
317+ args is a C array for positional arguments followed by values of
318+ keyword arguments. Keys of keyword arguments are stored as a tuple
319+ of strings in kwnames. nargs is the number of positional parameters at
320+ the beginning of stack. The size of kwnames gives the number of keyword
321+ values in the stack after positional arguments.
322+
323+ kwnames must only contains str strings, no subclass, and all keys must
324+ be unique.
325+
326+ If nargs is equal to zero and there is no keyword argument (kwnames is
327+ NULL or its size is zero), args can be NULL.
328+
329+ Return the result on success. Raise an exception and return NULL on
330+ error. */
331+ PyAPI_FUNC (PyObject * ) _PyObject_FastCallKeywords
332+ (PyObject * func ,
333+ PyObject * * args ,
334+ Py_ssize_t nargs ,
335+ PyObject * kwnames );
326336
327337#define _PyObject_FastCall (func , args , nargs ) \
328338 _PyObject_FastCallDict((func), (args), (nargs), NULL)
0 commit comments