+++ /dev/null
-#ifndef Py_CPYTHON_MODSUPPORT_H
-# error "this header file must not be included directly"
-#endif
-
-PyAPI_FUNC(int) _PyArg_UnpackStack(
- PyObject *const *args,
- Py_ssize_t nargs,
- const char *name,
- Py_ssize_t min,
- Py_ssize_t max,
- ...);
-
-PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kwargs);
-PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args);
-#define _PyArg_NoKeywords(funcname, kwargs) \
- ((kwargs) == NULL || _PyArg_NoKeywords((funcname), (kwargs)))
-#define _PyArg_NoPositional(funcname, args) \
- ((args) == NULL || _PyArg_NoPositional((funcname), (args)))
-
-#define _Py_ANY_VARARGS(n) ((n) == PY_SSIZE_T_MAX)
-
-PyAPI_FUNC(void) _PyArg_BadArgument(const char *, const char *, const char *, PyObject *);
-PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t,
- Py_ssize_t, Py_ssize_t);
-#define _PyArg_CheckPositional(funcname, nargs, min, max) \
- ((!_Py_ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \
- || _PyArg_CheckPositional((funcname), (nargs), (min), (max)))
-
-typedef struct _PyArg_Parser {
- int initialized;
- 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;
-
-PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
- struct _PyArg_Parser *, ...);
-PyAPI_FUNC(int) _PyArg_ParseStack(
- PyObject *const *args,
- Py_ssize_t nargs,
- const char *format,
- ...);
-PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords(
- PyObject *const *args,
- Py_ssize_t nargs,
- PyObject *kwnames,
- struct _PyArg_Parser *,
- ...);
-PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywords(
- PyObject *const *args, Py_ssize_t nargs,
- PyObject *kwargs, PyObject *kwnames,
- struct _PyArg_Parser *parser,
- int minpos, int maxpos, int minkw,
- PyObject **buf);
-
-PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywordsWithVararg(
- PyObject *const *args, Py_ssize_t nargs,
- PyObject *kwargs, PyObject *kwnames,
- struct _PyArg_Parser *parser,
- int minpos, int maxpos, int minkw,
- int vararg, PyObject **buf);
-
-#define _PyArg_UnpackKeywords(args, nargs, kwargs, kwnames, parser, minpos, maxpos, minkw, buf) \
- (((minkw) == 0 && (kwargs) == NULL && (kwnames) == NULL && \
- (minpos) <= (nargs) && (nargs) <= (maxpos) && (args) != NULL) ? (args) : \
- _PyArg_UnpackKeywords((args), (nargs), (kwargs), (kwnames), (parser), \
- (minpos), (maxpos), (minkw), (buf)))
#define _PyArg_NoKwnames(funcname, kwnames) \
((kwnames) == NULL || _PyArg_NoKwnames((funcname), (kwnames)))
+// Export for '_bz2' shared extension
+PyAPI_FUNC(int) _PyArg_NoPositional(const char *funcname, PyObject *args);
+#define _PyArg_NoPositional(funcname, args) \
+ ((args) == NULL || _PyArg_NoPositional((funcname), (args)))
+
+// Export for '_asyncio' shared extension
+PyAPI_FUNC(int) _PyArg_NoKeywords(const char *funcname, PyObject *kwargs);
+#define _PyArg_NoKeywords(funcname, kwargs) \
+ ((kwargs) == NULL || _PyArg_NoKeywords((funcname), (kwargs)))
+
+// Export for 'zlib' shared extension
+PyAPI_FUNC(int) _PyArg_CheckPositional(const char *, Py_ssize_t,
+ Py_ssize_t, Py_ssize_t);
+#define _Py_ANY_VARARGS(n) ((n) == PY_SSIZE_T_MAX)
+#define _PyArg_CheckPositional(funcname, nargs, min, max) \
+ ((!_Py_ANY_VARARGS(max) && (min) <= (nargs) && (nargs) <= (max)) \
+ || _PyArg_CheckPositional((funcname), (nargs), (min), (max)))
+
extern PyObject ** _Py_VaBuildStack(
PyObject **small_stack,
Py_ssize_t small_stack_len,
extern PyObject* _PyModule_CreateInitialized(PyModuleDef*, int apiver);
+// Export for '_curses' shared extension
+PyAPI_FUNC(int) _PyArg_ParseStack(
+ PyObject *const *args,
+ Py_ssize_t nargs,
+ const char *format,
+ ...);
+
+extern int _PyArg_UnpackStack(
+ PyObject *const *args,
+ Py_ssize_t nargs,
+ const char *name,
+ Py_ssize_t min,
+ Py_ssize_t max,
+ ...);
+
+// Export for '_heapq' shared extension
+PyAPI_FUNC(void) _PyArg_BadArgument(
+ const char *fname,
+ const char *displayname,
+ const char *expected,
+ PyObject *arg);
+
+// --- _PyArg_Parser API ---------------------------------------------------
+
+typedef struct _PyArg_Parser {
+ int initialized;
+ 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;
+
+// Export for '_testclinic' shared extension
+PyAPI_FUNC(int) _PyArg_ParseTupleAndKeywordsFast(PyObject *, PyObject *,
+ struct _PyArg_Parser *, ...);
+
+// Export for '_dbm' shared extension
+PyAPI_FUNC(int) _PyArg_ParseStackAndKeywords(
+ PyObject *const *args,
+ Py_ssize_t nargs,
+ PyObject *kwnames,
+ struct _PyArg_Parser *,
+ ...);
+
+// Export for 'math' shared extension
+PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywords(
+ PyObject *const *args,
+ Py_ssize_t nargs,
+ PyObject *kwargs,
+ PyObject *kwnames,
+ struct _PyArg_Parser *parser,
+ int minpos,
+ int maxpos,
+ int minkw,
+ PyObject **buf);
+#define _PyArg_UnpackKeywords(args, nargs, kwargs, kwnames, parser, minpos, maxpos, minkw, buf) \
+ (((minkw) == 0 && (kwargs) == NULL && (kwnames) == NULL && \
+ (minpos) <= (nargs) && (nargs) <= (maxpos) && (args) != NULL) ? (args) : \
+ _PyArg_UnpackKeywords((args), (nargs), (kwargs), (kwnames), (parser), \
+ (minpos), (maxpos), (minkw), (buf)))
+
+// Export for '_testclinic' shared extension
+PyAPI_FUNC(PyObject * const *) _PyArg_UnpackKeywordsWithVararg(
+ PyObject *const *args, Py_ssize_t nargs,
+ PyObject *kwargs, PyObject *kwnames,
+ struct _PyArg_Parser *parser,
+ int minpos, int maxpos, int minkw,
+ int vararg, PyObject **buf);
+
#ifdef __cplusplus
}
#endif
#endif /* New in 3.5 */
-#ifndef Py_LIMITED_API
-# define Py_CPYTHON_MODSUPPORT_H
-# include "cpython/modsupport.h"
-# undef Py_CPYTHON_MODSUPPORT_H
-#endif
-
#ifdef __cplusplus
}
#endif
$(srcdir)/Include/cpython/longobject.h \
$(srcdir)/Include/cpython/memoryobject.h \
$(srcdir)/Include/cpython/methodobject.h \
- $(srcdir)/Include/cpython/modsupport.h \
$(srcdir)/Include/cpython/object.h \
$(srcdir)/Include/cpython/objimpl.h \
$(srcdir)/Include/cpython/odictobject.h \
--- /dev/null
+Move the undocumented private _PyArg functions and _PyArg_Parser structure
+to internal C API (``pycore_modsupport.h``). Patch by Victor Stinner.
#include "Python.h"
#include "pycore_dict.h" // _PyDict_GetItem_KnownHash()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
#include "pycore_moduleobject.h" // _PyModule_GetState()
#include "pycore_pyerrors.h" // _PyErr_ClearExcState()
#include "pycore_pylifecycle.h" // _Py_IsInterpreterFinalizing()
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_long.h" // _PyLong_UnsignedLong_Converter()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(py_blake2b_new__doc__,
"blake2b(data=b\'\', /, *, digest_size=_blake2.blake2b.MAX_DIGEST_SIZE,\n"
{
return _blake2_blake2b_hexdigest_impl(self);
}
-/*[clinic end generated code: output=2ad807e0c83d8c25 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=19b82b55c033d895 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_long.h" // _PyLong_UnsignedLong_Converter()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(py_blake2s_new__doc__,
"blake2s(data=b\'\', /, *, digest_size=_blake2.blake2s.MAX_DIGEST_SIZE,\n"
{
return _blake2_blake2s_hexdigest_impl(self);
}
-/*[clinic end generated code: output=90ca2b52b8c40785 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=79b3479e90f4d077 input=a9049054013a1b77]*/
#define MODULE_VERSION "1.0"
+// clinic/_csv.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
#include <stddef.h> // offsetof()
#include "pycore_call.h" // _PyObject_CallNoArgs()
#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
+#ifdef MS_WIN32
+# include "pycore_modsupport.h" // _PyArg_NoKeywords()
+#endif
#include "pycore_pyerrors.h" // _PyErr_WriteUnraisableMsg()
/* Includes */
+// clinic/_curses_panel.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
#include "py_curses.h"
/* DBM module using dictionary interface */
+// clinic/_dbmmodule.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
#include <sys/types.h>
-
/* GDBM module using dictionary interface */
/* Author: Anthony Baxter, after dbmmodule.c */
/* Doc strings: Mitch Chapman */
+// clinic/_gdbmmodule.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
#include "gdbm.h"
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_io_open__doc__,
"open($module, /, file, mode=\'r\', buffering=-1, encoding=None,\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=aaf96c8d9bd20abc input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5d60f4e778a600a4 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_BadArgument()
PyDoc_STRVAR(_io__BufferedIOBase_readinto__doc__,
"readinto($self, buffer, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=f940cea085f0bf91 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b83f65fad0cd5fb6 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(_io_BytesIO_readable__doc__,
"readable($self, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=b753fdf1ba36c461 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=27333725edff70a0 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_io_FileIO_close__doc__,
"close($self, /)\n"
#ifndef _IO_FILEIO_TRUNCATE_METHODDEF
#define _IO_FILEIO_TRUNCATE_METHODDEF
#endif /* !defined(_IO_FILEIO_TRUNCATE_METHODDEF) */
-/*[clinic end generated code: output=2ce6ce923ccef86e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=10838003d15e7b3d input=a9049054013a1b77]*/
[clinic start generated code]*/
#include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_io__IOBase_seek__doc__,
"seek($self, offset, whence=os.SEEK_SET, /)\n"
{
return _io__RawIOBase_readall_impl(self);
}
-/*[clinic end generated code: output=95e1633805d10294 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5a22bc5db0ecaacb input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(_io_StringIO_getvalue__doc__,
"getvalue($self, /)\n"
{
return _io_StringIO_seekable_impl(self);
}
-/*[clinic end generated code: output=57e86cd679344ee7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f56aa7f8a271acf6 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_io__TextIOBase_detach__doc__,
"detach($self, /)\n"
{
return _io_TextIOWrapper_close_impl(self);
}
-/*[clinic end generated code: output=175e1723a462a722 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e58ce89b7354e77a input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
#if defined(HAVE_WINDOWS_CONSOLE_IO)
#ifndef _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
#define _IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF
#endif /* !defined(_IO__WINDOWSCONSOLEIO_ISATTY_METHODDEF) */
-/*[clinic end generated code: output=37febc4c96732b3b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2debef253fa1ab90 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
#if defined(MS_WINDOWS)
PyDoc_STRVAR(_multiprocessing_closesocket__doc__,
#ifndef _MULTIPROCESSING_SEND_METHODDEF
#define _MULTIPROCESSING_SEND_METHODDEF
#endif /* !defined(_MULTIPROCESSING_SEND_METHODDEF) */
-/*[clinic end generated code: output=8b91c020d4353cc5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=48504f7a2d37958c input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
#if defined(HAVE_SHM_OPEN)
#ifndef _POSIXSHMEM_SHM_UNLINK_METHODDEF
#define _POSIXSHMEM_SHM_UNLINK_METHODDEF
#endif /* !defined(_POSIXSHMEM_SHM_UNLINK_METHODDEF) */
-/*[clinic end generated code: output=2f356903a281d857 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b525631f5915d7f3 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
#if defined(HAVE_MP_SEMAPHORE) && defined(MS_WINDOWS)
#ifndef _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF
#define _MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF
#endif /* !defined(_MULTIPROCESSING_SEMLOCK___EXIT___METHODDEF) */
-/*[clinic end generated code: output=e8ea65f8cba8e173 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d57992037e6770b6 input=a9049054013a1b77]*/
posixshmem - A Python extension that provides shm_open() and shm_unlink()
*/
+// clinic/posixshmem.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include <Python.h>
// for shm_open() and shm_unlink()
#include "Python.h"
#include "pycore_long.h" // _PyLong_AsByteArray()
+#include "pycore_modsupport.h" // _PyArg_NoKeywords()
#include "pycore_moduleobject.h" // _PyModule_GetState()
#include "pycore_pylifecycle.h" // _PyOS_URandomNonblock()
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(pysqlite_connect__doc__,
"connect($module, /, database, timeout=5.0, detect_types=0,\n"
#define PYSQLITE_CONNECT_METHODDEF \
{"connect", _PyCFunction_CAST(pysqlite_connect), METH_FASTCALL|METH_KEYWORDS, pysqlite_connect__doc__},
-/*[clinic end generated code: output=03bd99542e3aec9d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=69b9b00da71c3c0a input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(blob_close__doc__,
"close($self, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=8bfd79ab12ac5385 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=27c24afc687bd772 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
static int
pysqlite_connection_init_impl(pysqlite_Connection *self, PyObject *database,
#ifndef DESERIALIZE_METHODDEF
#define DESERIALIZE_METHODDEF
#endif /* !defined(DESERIALIZE_METHODDEF) */
-/*[clinic end generated code: output=166bf41ad5ca1655 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b9c27a406e329587 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
static int
pysqlite_cursor_init_impl(pysqlite_Cursor *self,
{
return pysqlite_cursor_close_impl(self);
}
-/*[clinic end generated code: output=0c52a9cf54d00543 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a8ce095c3c80cf65 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(pysqlite_complete_statement__doc__,
"complete_statement($module, /, statement)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=a14893a7c2eead5e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=457ab0fdbb9e1880 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
static PyObject *
pysqlite_row_new_impl(PyTypeObject *type, pysqlite_Cursor *cursor,
PyObject *data);
{
return pysqlite_row_keys_impl(self);
}
-/*[clinic end generated code: output=972487d535d2e7d5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=788bf817acc02b8e input=a9049054013a1b77]*/
#include "util.h"
#include "pycore_import.h" // _PyImport_GetModuleAttrString()
+#include "pycore_modsupport.h" // _PyArg_NoKeywords()
#include "pycore_pyerrors.h" // _PyErr_ChainExceptions1()
#include "pycore_pylifecycle.h" // _Py_IsInterpreterFinalizing()
#include "pycore_weakref.h" // _PyWeakref_IS_DEAD()
* 3. This notice may not be removed or altered from any source distribution.
*/
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "row.h"
#include "cursor.h"
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_sre_getcodesize__doc__,
"getcodesize($module, /)\n"
}
return _sre_SRE_Scanner_search_impl(self, cls);
}
-/*[clinic end generated code: output=46d83927cbafa93a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ad513f31b99505fa input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_ssl_Certificate_public_bytes__doc__,
"public_bytes($self, /, format=Encoding.PEM)\n"
{
return _ssl_Certificate_get_info_impl(self);
}
-/*[clinic end generated code: output=8e438b54fbebd53e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5b668226f933a677 input=a9049054013a1b77]*/
/* statistics accelerator C extension: _statistics module. */
+// clinic/_statisticsmodule.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
#include "clinic/_statisticsmodule.c.h"
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(_testcapi_err_set_raised__doc__,
"err_set_raised($module, exception, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=ff19512450b3bbdb input=a9049054013a1b77]*/
+/*[clinic end generated code: output=0b11ef105030a48e input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_testcapi_float_pack__doc__,
"float_pack($module, size, d, le, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=50146051f1341cce input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b43dfd3a77fe04ba input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_testcapi_pyobject_fastcalldict__doc__,
"pyobject_fastcalldict($module, func, func_args, kwargs, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=0667266b825ec9ec input=a9049054013a1b77]*/
+/*[clinic end generated code: output=210ae67caab177ba input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_testcapi_watch_dict__doc__,
"watch_dict($module, watcher_id, dict, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=5ad5771d6b29dfb9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=0e07ce7f295917a5 input=a9049054013a1b77]*/
+// clinic/exceptions.c.h uses internal pycore_modsupport.h API
+#define PYTESTCAPI_NEED_INTERNAL_API
+
#include "parts.h"
#include "util.h"
#include "clinic/exceptions.c.h"
+// clinic/float.c.h uses internal pycore_modsupport.h API
+#define PYTESTCAPI_NEED_INTERNAL_API
+
#include "parts.h"
#include "clinic/float.c.h"
// Always enable assertions
#undef NDEBUG
-// The _testcapi extension tests the public C API: header files in Include/ and
-// Include/cpython/ directories. The internal C API must not be tested by
-// _testcapi: use _testinternalcapi for that.
-//
-// _testcapi C files can built with the Py_BUILD_CORE_BUILTIN macro defined if
-// one of the Modules/Setup files asks to build _testcapi as "static"
-// (gh-109723).
-//
-// The Visual Studio projects builds _testcapi with Py_BUILD_CORE_MODULE.
-#undef Py_BUILD_CORE_MODULE
-#undef Py_BUILD_CORE_BUILTIN
+#ifdef PYTESTCAPI_NEED_INTERNAL_API
+# ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+# endif
+#else
+ // The _testcapi extension tests the public C API: header files in Include/
+ // and Include/cpython/ directories. The internal C API must not be tested
+ // by _testcapi: use _testinternalcapi for that.
+ //
+ // _testcapi C files can built with the Py_BUILD_CORE_BUILTIN macro defined
+ // if one of the Modules/Setup files asks to build _testcapi as "static"
+ // (gh-109723).
+ //
+ // The Visual Studio projects builds _testcapi with Py_BUILD_CORE_MODULE.
+# undef Py_BUILD_CORE_MODULE
+# undef Py_BUILD_CORE_BUILTIN
+#endif
#include "Python.h"
-#ifdef Py_BUILD_CORE
+#if defined(Py_BUILD_CORE) && !defined(PYTESTCAPI_NEED_INTERNAL_API)
# error "_testcapi must test the public Python C API, not the internal C API"
#endif
+// clinic/vectorcall.c.h uses internal pycore_modsupport.h API
+#define PYTESTCAPI_NEED_INTERNAL_API
+
#include "parts.h"
#include "clinic/vectorcall.c.h"
+// clinic/watchers.c.h uses internal pycore_modsupport.h API
+#define PYTESTCAPI_NEED_INTERNAL_API
+
#include "parts.h"
#include "clinic/watchers.c.h"
return repr(self)
*/
static PyObject*
-bad_get(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
+bad_get(PyObject *module, PyObject *args)
{
PyObject *self, *obj, *cls;
- if (!_PyArg_UnpackStack(args, nargs, "bad_get", 3, 3, &self, &obj, &cls)) {
+ if (!PyArg_ParseTuple(args, "OOO", &self, &obj, &cls)) {
return NULL;
}
{"W_STOPCODE", py_w_stopcode, METH_VARARGS},
#endif
{"test_pythread_tss_key_state", test_pythread_tss_key_state, METH_VARARGS},
- {"bad_get", _PyCFunction_CAST(bad_get), METH_FASTCALL},
+ {"bad_get", bad_get, METH_VARARGS},
#ifdef Py_REF_DEBUG
{"negative_refcount", negative_refcount, METH_NOARGS},
{"decref_freed_object", decref_freed_object, METH_NOARGS},
[clinic start generated code]*/
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(_testinternalcapi_benchmark_locks__doc__,
"benchmark_locks($module, num_threads, use_pymutex=True,\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=97c85dff601fed4b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=105105d759c0c271 input=a9049054013a1b77]*/
#endif
#include "Python.h"
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
#include "pycore_namespace.h" // _PyNamespace_New()
/* State for testing module state access from methods */
#include "Python.h"
#include "pycore_initconfig.h" // _PyErr_SetFromPyStatus()
+#include "pycore_modsupport.h" // _PyArg_BadArgument()
#include "pycore_pyerrors.h" // _PyErr_ChainExceptions1()
#include "pycore_pystate.h" // _PyInterpreterState_SetRunningMain()
+
#include "interpreteridobject.h"
#include "marshal.h" // PyMarshal_ReadObjectFromString()
#include "pycore_call.h" // _PyObject_CallMethod()
#include "pycore_ceval.h" // _PyEval_GetBuiltin()
#include "pycore_long.h" // _PyLong_FromByteArray()
+#include "pycore_modsupport.h" // _PyArg_NoKeywords()
#include "pycore_moduleobject.h" // _PyModule_GetState()
#include <stddef.h> // offsetof()
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_multibytecodec_MultibyteCodec_encode__doc__,
"encode($self, /, input, errors=None)\n"
#define _MULTIBYTECODEC___CREATE_CODEC_METHODDEF \
{"__create_codec", (PyCFunction)_multibytecodec___create_codec, METH_O, _multibytecodec___create_codec__doc__},
-/*[clinic end generated code: output=1ee928e7a85e9d34 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=38f8d42721eea1e6 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_abc__reset_registry__doc__,
"_reset_registry($module, self, /)\n"
"--\n"
{
return _abc_get_cache_token_impl(module);
}
-/*[clinic end generated code: output=babb3ce445fa9b21 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1989b6716c950e17 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_asyncio_Future___init____doc__,
"Future(*, loop=None)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=1b7658bfab7024f3 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f3864d8e2af7635f input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_bisect_bisect_right__doc__,
"bisect_right($module, /, a, x, lo=0, hi=None, *, key=None)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=43ece163c3e972df input=a9049054013a1b77]*/
+/*[clinic end generated code: output=4af5bd405149bf5f input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_BadArgument()
PyDoc_STRVAR(_bz2_BZ2Compressor_compress__doc__,
"compress($self, data, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=3dfc8436fa8eaefb input=a9049054013a1b77]*/
+/*[clinic end generated code: output=90f7b5c451c0a8bf input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_BadArgument()
PyDoc_STRVAR(_codecs_register__doc__,
"register($module, search_function, /)\n"
#ifndef _CODECS_CODE_PAGE_ENCODE_METHODDEF
#define _CODECS_CODE_PAGE_ENCODE_METHODDEF
#endif /* !defined(_CODECS_CODE_PAGE_ENCODE_METHODDEF) */
-/*[clinic end generated code: output=3473564544f10403 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=40cf63bf2da18359 input=a9049054013a1b77]*/
[clinic start generated code]*/
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(_collections__count_elements__doc__,
"_count_elements($module, mapping, iterable, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=b01ddb9fdecc4a2d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c896a72f8c45930d input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_csv_list_dialects__doc__,
"list_dialects($module, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=4704d708f5745e91 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=9ec59717f5414d8b input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
+
PyDoc_STRVAR(_curses_panel_panel_bottom__doc__,
"bottom($self, /)\n"
"--\n"
{
return _curses_panel_update_panels_impl(module);
}
-/*[clinic end generated code: output=dd302cb9afc42f40 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=636beecf71d96ff1 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(_curses_window_addch__doc__,
"addch([y, x,] ch, [attr=_curses.A_NORMAL])\n"
#ifndef _CURSES_USE_DEFAULT_COLORS_METHODDEF
#define _CURSES_USE_DEFAULT_COLORS_METHODDEF
#endif /* !defined(_CURSES_USE_DEFAULT_COLORS_METHODDEF) */
-/*[clinic end generated code: output=839faafb638935ea input=a9049054013a1b77]*/
+/*[clinic end generated code: output=24ad16254d1eef9c input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(datetime_date_fromtimestamp__doc__,
"fromtimestamp($type, timestamp, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=e422c25b1c28f38b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=562813dd3e164794 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
+
PyDoc_STRVAR(_dbm_dbm_close__doc__,
"close($self, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=972d221f9da819d3 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=96fdd4bd7bd256c5 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_elementtree_Element_append__doc__,
"append($self, subelement, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=20d1869da79a43d7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=8fdaa17d3262800a input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_functools_cmp_to_key__doc__,
"cmp_to_key($module, /, mycmp)\n"
{
return _functools__lru_cache_wrapper_cache_clear_impl(self);
}
-/*[clinic end generated code: output=de9cf85e85167f43 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=231403340a20e31b input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_gdbm_gdbm_get__doc__,
"get($self, key, default=None, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=84f30c7fff0eadac input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c5ee922363d5a81f input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(EVP_copy__doc__,
"copy($self, /)\n"
#ifndef _HASHLIB_SCRYPT_METHODDEF
#define _HASHLIB_SCRYPT_METHODDEF
#endif /* !defined(_HASHLIB_SCRYPT_METHODDEF) */
-/*[clinic end generated code: output=75413752099f2dec input=a9049054013a1b77]*/
+/*[clinic end generated code: output=21ad88d46922dc00 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_heapq_heappush__doc__,
"heappush($module, heap, item, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=9a22715a8bf0c91d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=05f2afdf3bc54c9d input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_locale_setlocale__doc__,
"setlocale($module, category, locale=<unrepresentable>, /)\n"
"--\n"
#ifndef _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF
#define _LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF
#endif /* !defined(_LOCALE_BIND_TEXTDOMAIN_CODESET_METHODDEF) */
-/*[clinic end generated code: output=3abe7fade999eff6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=034a3c219466d207 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_BadArgument()
PyDoc_STRVAR(_lzma_LZMACompressor_compress__doc__,
"compress($self, data, /)\n"
return return_value;
}
-/*[clinic end generated code: output=eadc9ee7a11a06f5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=fca7d2b5800dc4c1 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_opcode_stack_effect__doc__,
"stack_effect($module, opcode, oparg=None, /, *, jump=None)\n"
{
return _opcode_get_intrinsic2_descs_impl(module);
}
-/*[clinic end generated code: output=d608239a4c7a05a1 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a1052bb1deffb7f2 input=a9049054013a1b77]*/
[clinic start generated code]*/
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(_operator_truth__doc__,
"truth($module, a, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=9658aca50a9ad991 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ddbba2cd943571eb input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_pickle_Pickler_clear_memo__doc__,
"clear_memo($self, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=57c209a12264146d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7f0564b5fb5410a8 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(subprocess_fork_exec__doc__,
"fork_exec($module, args, executable_list, close_fds, pass_fds, cwd,\n"
" env, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite,\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=a83b11467169b97b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=48555f5965a871be input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_NoKeywords()
PyDoc_STRVAR(simplequeue_new__doc__,
"SimpleQueue()\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=5c326e4c1f2a1ad7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=457310b20cb61cf8 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_random_Random_random__doc__,
"random($self, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=5e7e05d756a7e1c7 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5c800a28c2d7b9d1 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(_ssl__SSLSocket_do_handshake__doc__,
"do_handshake($self, /)\n"
#ifndef _SSL_ENUM_CRLS_METHODDEF
#define _SSL_ENUM_CRLS_METHODDEF
#endif /* !defined(_SSL_ENUM_CRLS_METHODDEF) */
-/*[clinic end generated code: output=a47d575abe0aceb6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f15635b2faa3b2db input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_statistics__normal_dist_inv_cdf__doc__,
"_normal_dist_inv_cdf($module, p, mu, sigma, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=b807a8243e7801e6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e7cead17f9f3e19f input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(Struct__doc__,
"Struct(format)\n"
return return_value;
}
-/*[clinic end generated code: output=5c1bc384ff87df1f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1749aaf639d5c11c input=a9049054013a1b77]*/
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
#include "pycore_long.h" // _PyLong_UnsignedShort_Converter()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
#include "pycore_runtime.h" // _Py_ID()
PyDoc_STRVAR(test_empty_function__doc__,
exit:
return return_value;
}
-/*[clinic end generated code: output=aea5f282f24761aa input=a9049054013a1b77]*/
+/*[clinic end generated code: output=90743ac900d60f9f input=a9049054013a1b77]*/
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
#include "pycore_long.h" // _PyLong_UnsignedShort_Converter()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
#include "pycore_runtime.h" // _Py_ID()
PyDoc_STRVAR(depr_star_new__doc__,
exit:
return return_value;
}
-/*[clinic end generated code: output=689b1e2d0872e413 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2c19d1804ba6e53b input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_testinternalcapi_compiler_cleandoc__doc__,
"compiler_cleandoc($module, /, doc)\n"
{
return _testinternalcapi_test_long_numbits_impl(module);
}
-/*[clinic end generated code: output=59144f59957627bd input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3425f97821fc7462 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_testmultiphase_StateAccessType_get_defining_module__doc__,
"get_defining_module($self, /)\n"
}
return _testmultiphase_StateAccessType_get_count_impl(self, cls);
}
-/*[clinic end generated code: output=db1fdd15244ee59c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d8c262af27b3b98d input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_BadArgument()
+
PyDoc_STRVAR(_tkinter_tkapp_eval__doc__,
"eval($self, script, /)\n"
"--\n"
#ifndef _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
#define _TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF
#endif /* !defined(_TKINTER_TKAPP_DELETEFILEHANDLER_METHODDEF) */
-/*[clinic end generated code: output=bcd9cdc8f6bdcfae input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d447501ec5aa9447 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_tracemalloc_is_tracing__doc__,
"is_tracing($module, /)\n"
"--\n"
{
return _tracemalloc_reset_peak_impl(module);
}
-/*[clinic end generated code: output=ad7d1fae89f2bdaa input=a9049054013a1b77]*/
+/*[clinic end generated code: output=9d4d884b156c2ddb input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_weakref_getweakrefcount__doc__,
"getweakrefcount($module, object, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=f4be6b8177fbceb8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=60f59adc1dc9eab8 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_long.h" // _PyLong_Size_t_Converter()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_winapi_Overlapped_GetOverlappedResult__doc__,
"GetOverlappedResult($self, wait, /)\n"
return return_value;
}
-/*[clinic end generated code: output=6df38b5eb93f2e5a input=a9049054013a1b77]*/
+/*[clinic end generated code: output=aaf29735c47f55fe input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(zoneinfo_ZoneInfo_from_file__doc__,
"from_file($type, file_obj, /, key=None)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=a5384f79d49a593b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2a15f32fdd2ab6cd input=a9049054013a1b77]*/
[clinic start generated code]*/
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(array_array___copy____doc__,
"__copy__($self, /)\n"
#define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \
{"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__},
-/*[clinic end generated code: output=8595b1906b5a6552 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d58693e1157540ef input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(binascii_a2b_uu__doc__,
"a2b_uu($module, data, /)\n"
return return_value;
}
-/*[clinic end generated code: output=acc9419209dfd568 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=3259f3b018abee96 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(cmath_acos__doc__,
"acos($module, z, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=96a5c4ae198dd5bf input=a9049054013a1b77]*/
+/*[clinic end generated code: output=364093af55bfe53f input=a9049054013a1b77]*/
[clinic start generated code]*/
#include "pycore_fileutils.h" // _PyLong_FileDescriptor_Converter()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(fcntl_fcntl__doc__,
"fcntl($module, fd, cmd, arg=0, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=4d4fac195494faec input=a9049054013a1b77]*/
+/*[clinic end generated code: output=732e33ba92042031 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _Py_convert_optional_to_ssize_t()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(gc_enable__doc__,
"enable($module, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=63093e7724b94a37 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5c345e7b4ce6085a input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(grp_getgrgid__doc__,
"getgrgid($module, /, id)\n"
{
return grp_getgrall_impl(module);
}
-/*[clinic end generated code: output=d4bdad9b26fb8558 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=2f7011384604d38d input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(batched_new__doc__,
"batched(iterable, n)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=95bb863274717bd9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=782fe7e30733779b input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(math_ceil__doc__,
"ceil($module, x, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=da62cea7eb3dc8bc input=a9049054013a1b77]*/
+/*[clinic end generated code: output=6b2eeaed8d8a76d5 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_long.h" // _PyLong_UnsignedLong_Converter()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(_overlapped_CreateIoCompletionPort__doc__,
"CreateIoCompletionPort($module, handle, port, key, concurrency, /)\n"
return return_value;
}
-/*[clinic end generated code: output=31bcc780209593a2 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=85884c2341fcbef7 input=a9049054013a1b77]*/
#include "pycore_abstract.h" // _PyNumber_Index()
#include "pycore_fileutils.h" // _PyLong_FileDescriptor_Converter()
#include "pycore_long.h" // _PyLong_UnsignedInt_Converter()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(os_stat__doc__,
"stat($module, /, path, *, dir_fd=None, follow_symlinks=True)\n"
#ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#define OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */
-/*[clinic end generated code: output=7c3058135ed49d20 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=274174066fff3256 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_BadArgument()
+
PyDoc_STRVAR(pwd_getpwuid__doc__,
"getpwuid($module, uidobj, /)\n"
"--\n"
#ifndef PWD_GETPWALL_METHODDEF
#define PWD_GETPWALL_METHODDEF
#endif /* !defined(PWD_GETPWALL_METHODDEF) */
-/*[clinic end generated code: output=211c7a2516899b91 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5a8fb12939ff4ea3 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(pyexpat_xmlparser_Parse__doc__,
"Parse($self, data, isfinal=False, /)\n"
#ifndef PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
#define PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF
#endif /* !defined(PYEXPAT_XMLPARSER_USEFOREIGNDTD_METHODDEF) */
-/*[clinic end generated code: output=ac398d94833e802d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=48c4296e43777df4 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(readline_parse_and_bind__doc__,
"parse_and_bind($module, string, /)\n"
"--\n"
#ifndef READLINE_CLEAR_HISTORY_METHODDEF
#define READLINE_CLEAR_HISTORY_METHODDEF
#endif /* !defined(READLINE_CLEAR_HISTORY_METHODDEF) */
-/*[clinic end generated code: output=790ed2ba01babb60 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=358ab465285c7949 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
#if defined(HAVE_GETRUSAGE)
PyDoc_STRVAR(resource_getrusage__doc__,
#ifndef RESOURCE_PRLIMIT_METHODDEF
#define RESOURCE_PRLIMIT_METHODDEF
#endif /* !defined(RESOURCE_PRLIMIT_METHODDEF) */
-/*[clinic end generated code: output=2376b9a3f03777aa input=a9049054013a1b77]*/
+/*[clinic end generated code: output=8e905b2f5c35170e input=a9049054013a1b77]*/
#endif
#include "pycore_fileutils.h" // _PyLong_FileDescriptor_Converter()
#include "pycore_long.h" // _PyLong_UnsignedShort_Converter()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(select_select__doc__,
"select($module, rlist, wlist, xlist, timeout=None, /)\n"
#ifndef SELECT_KQUEUE_CONTROL_METHODDEF
#define SELECT_KQUEUE_CONTROL_METHODDEF
#endif /* !defined(SELECT_KQUEUE_CONTROL_METHODDEF) */
-/*[clinic end generated code: output=35cd4aa7b6802838 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=4c2dcb31cb17c2c6 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(SHA1Type_copy__doc__,
"copy($self, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=7efbe42154a7a7f8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=41fc7579213b57b4 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(SHA256Type_copy__doc__,
"copy($self, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=1242ccc50bcefe98 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1482d9de086e45c4 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_long.h" // _PyLong_UnsignedLong_Converter()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(py_sha3_new__doc__,
"sha3_224(data=b\'\', /, *, usedforsecurity=True)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=0888aed37ef39984 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a8e76a880d1421ec input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(signal_default_int_handler__doc__,
"default_int_handler($module, signalnum, frame, /)\n"
"--\n"
#ifndef SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
#define SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF
#endif /* !defined(SIGNAL_PIDFD_SEND_SIGNAL_METHODDEF) */
-/*[clinic end generated code: output=ef4c2ad1a2443063 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5a9928cb2dc75b5f input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
static int
sock_initobj_impl(PySocketSockObject *self, int family, int type, int proto,
exit:
return return_value;
}
-/*[clinic end generated code: output=1b68ae94d6cbeeb1 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c85517815c2d69cf input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_symtable_symtable__doc__,
"symtable($module, source, filename, startstr, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=3f7ccf535d750238 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=931964a76a72f850 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(syslog_openlog__doc__,
"openlog($module, /, ident=<unrepresentable>, logoption=0,\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=68942dad7fb3872e input=a9049054013a1b77]*/
+/*[clinic end generated code: output=86ca2fd84b2da98e input=a9049054013a1b77]*/
[clinic start generated code]*/
#include "pycore_fileutils.h" // _PyLong_FileDescriptor_Converter()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(termios_tcgetattr__doc__,
"tcgetattr($module, fd, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=daecc8ebc8fe29f5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f31382658135c774 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(unicodedata_UCD_decimal__doc__,
"decimal($self, chr, default=<unrepresentable>, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=ca10ded25747d182 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ea30f89007b2bfff input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(zlib_compress__doc__,
"compress($module, data, /, level=Z_DEFAULT_COMPRESSION, wbits=MAX_WBITS)\n"
#ifndef ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
#define ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF
#endif /* !defined(ZLIB_DECOMPRESS___DEEPCOPY___METHODDEF) */
-/*[clinic end generated code: output=6d90c72ba2dd04c5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=bd96ba786b0d8d42 input=a9049054013a1b77]*/
/* UNIX group file access module */
+// clinic/grpmodule.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
#include "posixmodule.h"
+// clinic/resource.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
#include <errno.h> // errno
#include <string.h>
/* syslog module */
+// clinic/syslogmodule.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include "Python.h"
#include "osdefs.h" // SEP
/* Cell object implementation */
#include "Python.h"
+#include "pycore_modsupport.h" // _PyArg_NoKeywords()
#include "pycore_object.h"
PyObject *
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
static int
bytearray___init___impl(PyByteArrayObject *self, PyObject *arg,
{
return bytearray_sizeof_impl(self);
}
-/*[clinic end generated code: output=94b9b5f492b5fed6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=fc2b9ccabe0e6782 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(bytes___bytes____doc__,
"__bytes__($self, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=8a9f5c28cbfe7592 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=da013a7e257f5c6e input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(method___reduce____doc__,
"__reduce__($self, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=a0d17bad3b0734d9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5a5e3f2d0726f189 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(code_new__doc__,
"code(argcount, posonlyargcount, kwonlyargcount, nlocals, stacksize,\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=b9ccfbfabe1a5f46 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d604263a3ca72a0f input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_BadArgument()
PyDoc_STRVAR(complex_conjugate__doc__,
"conjugate($self, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=002c74f8a33b6697 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=04e6261649967b30 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
static PyObject *
mappingproxy_new_impl(PyTypeObject *type, PyObject *mapping);
exit:
return return_value;
}
-/*[clinic end generated code: output=a97dc44d12f9f9b6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a4664ccf3da10f5a input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(dict_fromkeys__doc__,
"fromkeys($type, iterable, value=None, /)\n"
"--\n"
{
return dict___reversed___impl(self);
}
-/*[clinic end generated code: output=582766ac0154c8bf input=a9049054013a1b77]*/
+/*[clinic end generated code: output=17c3c4cf9a9b95a7 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(enum_new__doc__,
"enumerate(iterable, start=0)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=661b29708f501d19 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5c48a9a482a52e91 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(float_is_integer__doc__,
"is_integer($self, /)\n"
"--\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=eb093cc601cc5426 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c79743c8551c30d9 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(func_new__doc__,
"function(code, globals, name=None, argdefs=None, closure=None)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=b2d676ff51c992d0 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ff7b995500d2bee6 input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(list_insert__doc__,
"insert($self, index, object, /)\n"
{
return list___reversed___impl(self);
}
-/*[clinic end generated code: output=e2d9f4092498a5ca input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5dea9dd3bb219a7f input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
static PyObject *
long_new_impl(PyTypeObject *type, PyObject *x, PyObject *obase);
{
return int_is_integer_impl(self);
}
-/*[clinic end generated code: output=009a537ab558763c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7e6e57246e55911f input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(memoryview__doc__,
"memoryview(object)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=7ebdadda3b0fcd35 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=7e76a09106921ba2 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(module___init____doc__,
"module(name, doc=None)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=9d3d7854d17a033c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=e8a71bfbed774c15 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(OrderedDict_fromkeys__doc__,
"fromkeys($type, /, iterable, value=None)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=6d7ae9fb552c6108 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=eff78d2a3f9379bd input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
static PyObject *
structseq_new_impl(PyTypeObject *type, PyObject *arg, PyObject *dict);
exit:
return return_value;
}
-/*[clinic end generated code: output=2f88fe2a6f5c13a8 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5bf39b3f06a34ce4 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(tuple_index__doc__,
"index($self, value, start=0, stop=sys.maxsize, /)\n"
"--\n"
{
return tuple___getnewargs___impl(self);
}
-/*[clinic end generated code: output=7c5d9d12e0cf6a83 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a6a9abba5d121f4c input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_BadArgument()
+
PyDoc_STRVAR(type___instancecheck____doc__,
"__instancecheck__($self, instance, /)\n"
"--\n"
{
return object___dir___impl(self);
}
-/*[clinic end generated code: output=943f639f264362d9 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b56c87f9cace1921 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywordsWithVararg()
PyDoc_STRVAR(typevar_new__doc__,
"typevar(name, *constraints, bound=None, covariant=False,\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=027fb8cbef6e5015 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=5a582d9d89ad787b input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(EncodingMap_size__doc__,
"size($self, /)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=4acdcfdc93f2a0f6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=873d8b3d09af3095 input=a9049054013a1b77]*/
#include "pycore_ceval.h" // _Py_EnterRecursiveCallTstate()
#include "pycore_emscripten_trampoline.h" // descr_set_trampoline_call(), descr_get_trampoline_call()
#include "pycore_descrobject.h" // _PyMethodWrapper_Type
+#include "pycore_modsupport.h" // _PyArg_UnpackStack()
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
#include "pycore_pystate.h" // _PyThreadState_GET()
#include "pycore_tuple.h" // _PyTuple_ITEMS()
#include <stdbool.h>
#include "pycore_abstract.h" // _PyObject_RealIsSubclass()
#include "pycore_ceval.h" // _Py_EnterRecursiveCall
-#include "pycore_pyerrors.h" // struct _PyErr_SetRaisedException
#include "pycore_exceptions.h" // struct _Py_exc_state
#include "pycore_initconfig.h"
+#include "pycore_modsupport.h" // _PyArg_NoKeywords()
#include "pycore_object.h"
+#include "pycore_pyerrors.h" // struct _PyErr_SetRaisedException
#include "osdefs.h" // SEP
#include "Python.h"
#include "pycore_ceval.h" // _PyEval_BuiltinsFromGlobals()
+#include "pycore_modsupport.h" // _PyArg_NoKeywords()
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
#include "pycore_pyerrors.h" // _PyErr_Occurred()
#include "Python.h"
#include "pycore_ceval.h" // _PyEval_GetBuiltin()
+#include "pycore_modsupport.h" // _PyArg_NoKeywords()
#include "pycore_object.h"
#include "pycore_unionobject.h" // _Py_union_type_or, _PyGenericAlias_Check
#include "pycore_ceval.h" // _PyEval_EvalFrame()
#include "pycore_frame.h" // _PyInterpreterFrame
#include "pycore_genobject.h" // struct _Py_async_gen_state
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
#include "pycore_object.h" // _PyObject_GC_UNTRACK()
#include "pycore_pyerrors.h" // _PyErr_ClearExcState()
#include "pycore_pystate.h" // _PyThreadState_GET()
// namespace object implementation
#include "Python.h"
+#include "pycore_modsupport.h" // _PyArg_NoPositional()
#include "pycore_namespace.h" // _PyNamespace_Type
#include <stddef.h> // offsetof()
-
typedef struct {
PyObject_HEAD
PyObject *ns_dict;
#include "Python.h"
#include "pycore_abstract.h" // _PyIndex_Check()
#include "pycore_long.h" // _PyLong_GetZero()
+#include "pycore_modsupport.h" // _PyArg_NoKeywords()
#include "pycore_object.h" // _PyObject_GC_TRACK()
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(stringlib_expandtabs__doc__,
"expandtabs($self, /, tabsize=8)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=39cd1ee983137188 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b409bdf9ab68d5a6 input=a9049054013a1b77]*/
#include "Python.h"
#include "pycore_dict.h" // _PyDict_Pop()
-#include "pycore_tuple.h" // _PyTuple_FromArray()
+#include "pycore_initconfig.h" // _PyStatus_OK()
+#include "pycore_modsupport.h" // _PyArg_NoPositional()
#include "pycore_object.h" // _PyObject_GC_TRACK()
-
#include "pycore_structseq.h" // PyStructSequence_InitType()
-#include "pycore_initconfig.h" // _PyStatus_OK()
+#include "pycore_tuple.h" // _PyTuple_FromArray()
static const char visible_length_key[] = "n_sequence_fields";
static const char real_length_key[] = "n_fields";
// Version history
// 2022-08: Initial contribution (Steve Dower)
+// clinic/_wmimodule.cpp.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#define _WIN32_DCOM
#include <Windows.h>
#include <comdef.h>
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
#if defined(MS_WINDOWS)
#ifndef _TESTCONSOLE_READ_OUTPUT_METHODDEF
#define _TESTCONSOLE_READ_OUTPUT_METHODDEF
#endif /* !defined(_TESTCONSOLE_READ_OUTPUT_METHODDEF) */
-/*[clinic end generated code: output=f59fe72cd4e73704 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=08a1c844b3657272 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(_wmi_exec_query__doc__,
"exec_query($module, /, query)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=53821e597fc2aca4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ba04920d127f3ceb input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(msvcrt_heapmin__doc__,
"heapmin($module, /)\n"
"--\n"
#ifndef MSVCRT_GETERRORMODE_METHODDEF
#define MSVCRT_GETERRORMODE_METHODDEF
#endif /* !defined(MSVCRT_GETERRORMODE_METHODDEF) */
-/*[clinic end generated code: output=525ec6ac4e3cb4f2 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=de9687b46212c2ed input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_long.h" // _PyLong_UnsignedLong_Converter()
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
#if (defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES))
#ifndef WINREG_QUERYREFLECTIONKEY_METHODDEF
#define WINREG_QUERYREFLECTIONKEY_METHODDEF
#endif /* !defined(WINREG_QUERYREFLECTIONKEY_METHODDEF) */
-/*[clinic end generated code: output=d7ae41899af53d7c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1ee4098b2f143b6a input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(winsound_PlaySound__doc__,
"PlaySound($module, /, sound, flags)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=21584101f656198f input=a9049054013a1b77]*/
+/*[clinic end generated code: output=191d4fb1542c7abf input=a9049054013a1b77]*/
winsound.PlaySound(None, 0)
*/
+// clinic/winsound.c.h uses internal pycore_modsupport.h API
+#ifndef Py_BUILD_CORE_BUILTIN
+# define Py_BUILD_CORE_MODULE 1
+#endif
+
#include <Python.h>
#include <windows.h>
#include <mmsystem.h>
<ClInclude Include="..\Include\cpython\longobject.h" />
<ClInclude Include="..\Include\cpython\memoryobject.h" />
<ClInclude Include="..\Include\cpython\methodobject.h" />
- <ClInclude Include="..\Include\cpython\modsupport.h" />
<ClInclude Include="..\Include\cpython\object.h" />
<ClInclude Include="..\Include\cpython\objimpl.h" />
<ClInclude Include="..\Include\cpython\odictobject.h" />
<ClInclude Include="..\Include\cpython\methodobject.h">
<Filter>Include\cpython</Filter>
</ClInclude>
- <ClInclude Include="..\Include\cpython\modsupport.h">
- <Filter>Include\cpython</Filter>
- </ClInclude>
<ClInclude Include="..\Include\cpython\objimpl.h">
<Filter>Include\cpython</Filter>
</ClInclude>
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
static PyObject *
tokenizeriter_new_impl(PyTypeObject *type, PyObject *readline,
exit:
return return_value;
}
-/*[clinic end generated code: output=406b5a433a59069c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=dcd6ec48f06a092e input=a9049054013a1b77]*/
# include "pycore_runtime.h" // _Py_ID()
#endif
#include "pycore_abstract.h" // _PyNumber_Index()
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(warnings_warn__doc__,
"warn($module, /, message, category=None, stacklevel=1, source=None, *,\n"
{
return warnings_filters_mutated_impl(module);
}
-/*[clinic end generated code: output=8c396a721ef75739 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f2d4214c382717a6 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(builtin___import____doc__,
"__import__($module, /, name, globals=None, locals=None, fromlist=(),\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=607c62f2341ebfc0 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=31bded5d08647a57 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(_contextvars_Context_get__doc__,
"get($self, key, default=None, /)\n"
"--\n"
#define _CONTEXTVARS_CONTEXTVAR_RESET_METHODDEF \
{"reset", (PyCFunction)_contextvars_ContextVar_reset, METH_O, _contextvars_ContextVar_reset__doc__},
-/*[clinic end generated code: output=2436b16a92452869 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=b667826178444c3f input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
PyDoc_STRVAR(_imp_lock_held__doc__,
"lock_held($module, /)\n"
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
#define _IMP_EXEC_DYNAMIC_METHODDEF
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
-/*[clinic end generated code: output=058f6aa1c9f4ebe4 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=c37ad1bf06f9e947 input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(monitoring_use_tool_id__doc__,
"use_tool_id($module, tool_id, name, /)\n"
"--\n"
{
return monitoring__all_events_impl(module);
}
-/*[clinic end generated code: output=46f449b18195f976 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=14ffc0884a6de50a input=a9049054013a1b77]*/
preserve
[clinic start generated code]*/
+#include "pycore_modsupport.h" // _PyArg_CheckPositional()
+
PyDoc_STRVAR(marshal_dump__doc__,
"dump($module, value, file, version=version, /)\n"
"--\n"
return return_value;
}
-/*[clinic end generated code: output=23091e077319f596 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=99ba446b1a75a269 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(sys_addaudithook__doc__,
"addaudithook($module, /, hook)\n"
#ifndef SYS_GETANDROIDAPILEVEL_METHODDEF
#define SYS_GETANDROIDAPILEVEL_METHODDEF
#endif /* !defined(SYS_GETANDROIDAPILEVEL_METHODDEF) */
-/*[clinic end generated code: output=3a7d3fbbcb281c22 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=f36d45c829250775 input=a9049054013a1b77]*/
# include "pycore_gc.h" // PyGC_Head
# include "pycore_runtime.h" // _Py_ID()
#endif
+#include "pycore_modsupport.h" // _PyArg_UnpackKeywords()
PyDoc_STRVAR(tb_new__doc__,
"TracebackType(tb_next, tb_frame, tb_lasti, tb_lineno)\n"
exit:
return return_value;
}
-/*[clinic end generated code: output=57e27eb68d04d842 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=4e2f6b935841b09c input=a9049054013a1b77]*/
#include "Python.h"
#include "pycore_abstract.h" // _PyNumber_Index()
#include "pycore_dict.h" // _PyDict_HasOnlyStringKeys()
+#include "pycore_modsupport.h" // export _PyArg_NoKeywords()
#include "pycore_pylifecycle.h" // _PyArg_Fini
#include "pycore_tuple.h" // _PyTuple_ITEMS()
""",
indent=4))
else:
+ clinic.add_include('pycore_modsupport.h',
+ '_PyArg_CheckPositional()')
parser_code = [normalize_snippet(f"""
if (!_PyArg_CheckPositional("{{name}}", {nargs}, {min_pos}, {max_args})) {{{{
goto exit;
if limited_capi:
fastcall = False
if fastcall:
+ clinic.add_include('pycore_modsupport.h',
+ '_PyArg_ParseStack()')
parser_code = [normalize_snippet("""
if (!_PyArg_ParseStack(args, nargs, "{format_units}:{name}",
{parse_arguments})) {{
has_optional_kw = (max(pos_only, min_pos) + min_kw_only < len(converters) - int(vararg != NO_VARARG))
if vararg == NO_VARARG:
+ # FIXME: refactor the code to not declare args_declaration
+ # if limited_capi is true
+ if not limited_capi:
+ clinic.add_include('pycore_modsupport.h',
+ '_PyArg_UnpackKeywords()')
args_declaration = "_PyArg_UnpackKeywords", "%s, %s, %s" % (
min_pos,
max_pos,
)
nargs = "nargs"
else:
+ if not limited_capi:
+ clinic.add_include('pycore_modsupport.h',
+ '_PyArg_UnpackKeywordsWithVararg()')
args_declaration = "_PyArg_UnpackKeywordsWithVararg", "%s, %s, %s, %s" % (
min_pos,
max_pos,
declarations += "\nPy_ssize_t nargs = PyTuple_Size(args);"
elif fastcall:
+ clinic.add_include('pycore_modsupport.h',
+ '_PyArg_ParseStackAndKeywords()')
parser_code = [normalize_snippet("""
if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser{parse_arguments_comma}
{parse_arguments})) {{
}}
""", indent=4)]
else:
+ clinic.add_include('pycore_modsupport.h',
+ '_PyArg_ParseTupleAndKeywordsFast()')
parser_code = [normalize_snippet("""
if (!_PyArg_ParseTupleAndKeywordsFast(args, kwargs, &_parser,
{parse_arguments})) {{
if not parses_keywords:
declarations = '{base_type_ptr}'
+ clinic.add_include('pycore_modsupport.h',
+ '_PyArg_NoKeywords()')
fields.insert(0, normalize_snippet("""
if ({self_type_check}!_PyArg_NoKeywords("{name}", kwargs)) {{
goto exit;
}}
""", indent=4))
if not parses_positional:
+ clinic.add_include('pycore_modsupport.h',
+ '_PyArg_NoPositional()')
fields.insert(0, normalize_snippet("""
if ({self_type_check}!_PyArg_NoPositional("{name}", args)) {{
goto exit;
else:
if expected_literal:
expected = f'"{expected}"'
+ if clinic is not None:
+ clinic.add_include('pycore_modsupport.h', '_PyArg_BadArgument()')
return f'_PyArg_BadArgument("{{{{name}}}}", "{displayname}", {expected}, {{argname}});'
def format_code(self, fmt: str, *,