diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-08-14 07:52:18 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-08-14 07:52:18 (GMT) |
commit | 9171a8b4cea3e7b30e4f2c0a989d7f7b8ffabe73 (patch) | |
tree | 5cc9c9243ba4ef93902fafdc624e56eab3b15842 /Include | |
parent | b6f78c2755489dfcbe4898072ef0cd7dca11ff3d (diff) | |
download | cpython-9171a8b4cea3e7b30e4f2c0a989d7f7b8ffabe73.zip cpython-9171a8b4cea3e7b30e4f2c0a989d7f7b8ffabe73.tar.gz cpython-9171a8b4cea3e7b30e4f2c0a989d7f7b8ffabe73.tar.bz2 |
Issue #27574: Decreased an overhead of parsing keyword arguments in functions
implemented with using Argument Clinic.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/modsupport.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Include/modsupport.h b/Include/modsupport.h index 829aaf8..6b0acb8 100644 --- a/Include/modsupport.h +++ b/Include/modsupport.h @@ -44,6 +44,29 @@ PyAPI_FUNC(int) PyArg_VaParseTupleAndKeywords(PyObject *, PyObject *, #endif PyAPI_FUNC(PyObject *) Py_VaBuildValue(const char *, va_list); +#ifndef Py_LIMITED_API +typedef struct _PyArg_Parser { + const char *format; + const char * const *keywords; + const char *fname; + const char *custom_msg; + int pos; /* number of positional-only arguments */ + int min; /* minimal number of arguments */ + int max; /* maximal number of positional arguments */ + PyObject *kwtuple; /* tuple of keyword parameter names */ + struct _PyArg_Parser *next; +} _PyArg_Parser; +#ifdef PY_SSIZE_T_CLEAN +#define _PyArg_ParseTupleAndKeywordsFast _PyArg_ParseTupleAndKeywordsFast_SizeT +#define _PyArg_VaParseTupleAndKeywordsFast _PyArg_VaParseTupleAndKeywordsFast_SizeT +#endif +PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *, + struct _PyArg_Parser *, ...); +PyAPI_FUNC(int) _PyArg_VaParseTupleAndKeywordsFast(PyObject *, PyObject *, + struct _PyArg_Parser *, va_list); +void _PyArg_Fini(void); +#endif + PyAPI_FUNC(int) PyModule_AddObject(PyObject *, const char *, PyObject *); PyAPI_FUNC(int) PyModule_AddIntConstant(PyObject *, const char *, long); PyAPI_FUNC(int) PyModule_AddStringConstant(PyObject *, const char *, const char *); |