1/* typing accelerator C extension: _typing module. */
2
3#include "Python.h"
4#include "clinic/_typingmodule.c.h"
5
6/*[clinic input]
7module _typing
8
9[clinic start generated code]*/
10/*[clinic end generated code: output=da39a3ee5e6b4b0d input=1db35baf1c72942b]*/
11
12/* helper function to make typing.NewType.__call__ method faster */
13
14/*[clinic input]
15_typing._idfunc -> object
16
17    x: object
18    /
19
20[clinic start generated code]*/
21
22static PyObject *
23_typing__idfunc(PyObject *module, PyObject *x)
24/*[clinic end generated code: output=63c38be4a6ec5f2c input=49f17284b43de451]*/
25{
26    Py_INCREF(x);
27    return x;
28}
29
30
31static PyMethodDef typing_methods[] = {
32    _TYPING__IDFUNC_METHODDEF
33    {NULL, NULL, 0, NULL}
34};
35
36PyDoc_STRVAR(typing_doc,
37"Accelerators for the typing module.\n");
38
39static struct PyModuleDef_Slot _typingmodule_slots[] = {
40    {0, NULL}
41};
42
43static struct PyModuleDef typingmodule = {
44        PyModuleDef_HEAD_INIT,
45        "_typing",
46        typing_doc,
47        0,
48        typing_methods,
49        _typingmodule_slots,
50        NULL,
51        NULL,
52        NULL
53};
54
55PyMODINIT_FUNC
56PyInit__typing(void)
57{
58    return PyModuleDef_Init(&typingmodule);
59}
60