Branch data Line data Source code
1 : : /*[clinic input]
2 : : preserve
3 : : [clinic start generated code]*/
4 : :
5 : : #if defined(Py_BUILD_CORE) && !defined(Py_BUILD_CORE_MODULE)
6 : : # include "pycore_gc.h" // PyGC_Head
7 : : # include "pycore_runtime.h" // _Py_ID()
8 : : #endif
9 : :
10 : :
11 : : PyDoc_STRVAR(_abc__reset_registry__doc__,
12 : : "_reset_registry($module, self, /)\n"
13 : : "--\n"
14 : : "\n"
15 : : "Internal ABC helper to reset registry of a given class.\n"
16 : : "\n"
17 : : "Should be only used by refleak.py");
18 : :
19 : : #define _ABC__RESET_REGISTRY_METHODDEF \
20 : : {"_reset_registry", (PyCFunction)_abc__reset_registry, METH_O, _abc__reset_registry__doc__},
21 : :
22 : : PyDoc_STRVAR(_abc__reset_caches__doc__,
23 : : "_reset_caches($module, self, /)\n"
24 : : "--\n"
25 : : "\n"
26 : : "Internal ABC helper to reset both caches of a given class.\n"
27 : : "\n"
28 : : "Should be only used by refleak.py");
29 : :
30 : : #define _ABC__RESET_CACHES_METHODDEF \
31 : : {"_reset_caches", (PyCFunction)_abc__reset_caches, METH_O, _abc__reset_caches__doc__},
32 : :
33 : : PyDoc_STRVAR(_abc__get_dump__doc__,
34 : : "_get_dump($module, self, /)\n"
35 : : "--\n"
36 : : "\n"
37 : : "Internal ABC helper for cache and registry debugging.\n"
38 : : "\n"
39 : : "Return shallow copies of registry, of both caches, and\n"
40 : : "negative cache version. Don\'t call this function directly,\n"
41 : : "instead use ABC._dump_registry() for a nice repr.");
42 : :
43 : : #define _ABC__GET_DUMP_METHODDEF \
44 : : {"_get_dump", (PyCFunction)_abc__get_dump, METH_O, _abc__get_dump__doc__},
45 : :
46 : : PyDoc_STRVAR(_abc__abc_init__doc__,
47 : : "_abc_init($module, self, /)\n"
48 : : "--\n"
49 : : "\n"
50 : : "Internal ABC helper for class set-up. Should be never used outside abc module.");
51 : :
52 : : #define _ABC__ABC_INIT_METHODDEF \
53 : : {"_abc_init", (PyCFunction)_abc__abc_init, METH_O, _abc__abc_init__doc__},
54 : :
55 : : PyDoc_STRVAR(_abc__abc_register__doc__,
56 : : "_abc_register($module, self, subclass, /)\n"
57 : : "--\n"
58 : : "\n"
59 : : "Internal ABC helper for subclasss registration. Should be never used outside abc module.");
60 : :
61 : : #define _ABC__ABC_REGISTER_METHODDEF \
62 : : {"_abc_register", _PyCFunction_CAST(_abc__abc_register), METH_FASTCALL, _abc__abc_register__doc__},
63 : :
64 : : static PyObject *
65 : : _abc__abc_register_impl(PyObject *module, PyObject *self, PyObject *subclass);
66 : :
67 : : static PyObject *
68 : 994 : _abc__abc_register(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
69 : : {
70 : 994 : PyObject *return_value = NULL;
71 : : PyObject *self;
72 : : PyObject *subclass;
73 : :
74 [ + - - + : 994 : if (!_PyArg_CheckPositional("_abc_register", nargs, 2, 2)) {
- - ]
75 : 0 : goto exit;
76 : : }
77 : 994 : self = args[0];
78 : 994 : subclass = args[1];
79 : 994 : return_value = _abc__abc_register_impl(module, self, subclass);
80 : :
81 : 994 : exit:
82 : 994 : return return_value;
83 : : }
84 : :
85 : : PyDoc_STRVAR(_abc__abc_instancecheck__doc__,
86 : : "_abc_instancecheck($module, self, instance, /)\n"
87 : : "--\n"
88 : : "\n"
89 : : "Internal ABC helper for instance checks. Should be never used outside abc module.");
90 : :
91 : : #define _ABC__ABC_INSTANCECHECK_METHODDEF \
92 : : {"_abc_instancecheck", _PyCFunction_CAST(_abc__abc_instancecheck), METH_FASTCALL, _abc__abc_instancecheck__doc__},
93 : :
94 : : static PyObject *
95 : : _abc__abc_instancecheck_impl(PyObject *module, PyObject *self,
96 : : PyObject *instance);
97 : :
98 : : static PyObject *
99 : 70253 : _abc__abc_instancecheck(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
100 : : {
101 : 70253 : PyObject *return_value = NULL;
102 : : PyObject *self;
103 : : PyObject *instance;
104 : :
105 [ + - - + : 70253 : if (!_PyArg_CheckPositional("_abc_instancecheck", nargs, 2, 2)) {
- - ]
106 : 0 : goto exit;
107 : : }
108 : 70253 : self = args[0];
109 : 70253 : instance = args[1];
110 : 70253 : return_value = _abc__abc_instancecheck_impl(module, self, instance);
111 : :
112 : 70253 : exit:
113 : 70253 : return return_value;
114 : : }
115 : :
116 : : PyDoc_STRVAR(_abc__abc_subclasscheck__doc__,
117 : : "_abc_subclasscheck($module, self, subclass, /)\n"
118 : : "--\n"
119 : : "\n"
120 : : "Internal ABC helper for subclasss checks. Should be never used outside abc module.");
121 : :
122 : : #define _ABC__ABC_SUBCLASSCHECK_METHODDEF \
123 : : {"_abc_subclasscheck", _PyCFunction_CAST(_abc__abc_subclasscheck), METH_FASTCALL, _abc__abc_subclasscheck__doc__},
124 : :
125 : : static PyObject *
126 : : _abc__abc_subclasscheck_impl(PyObject *module, PyObject *self,
127 : : PyObject *subclass);
128 : :
129 : : static PyObject *
130 : 1022 : _abc__abc_subclasscheck(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
131 : : {
132 : 1022 : PyObject *return_value = NULL;
133 : : PyObject *self;
134 : : PyObject *subclass;
135 : :
136 [ + - - + : 1022 : if (!_PyArg_CheckPositional("_abc_subclasscheck", nargs, 2, 2)) {
- - ]
137 : 0 : goto exit;
138 : : }
139 : 1022 : self = args[0];
140 : 1022 : subclass = args[1];
141 : 1022 : return_value = _abc__abc_subclasscheck_impl(module, self, subclass);
142 : :
143 : 1022 : exit:
144 : 1022 : return return_value;
145 : : }
146 : :
147 : : PyDoc_STRVAR(_abc_get_cache_token__doc__,
148 : : "get_cache_token($module, /)\n"
149 : : "--\n"
150 : : "\n"
151 : : "Returns the current ABC cache token.\n"
152 : : "\n"
153 : : "The token is an opaque object (supporting equality testing) identifying the\n"
154 : : "current version of the ABC cache for virtual subclasses. The token changes\n"
155 : : "with every call to register() on any ABC.");
156 : :
157 : : #define _ABC_GET_CACHE_TOKEN_METHODDEF \
158 : : {"get_cache_token", (PyCFunction)_abc_get_cache_token, METH_NOARGS, _abc_get_cache_token__doc__},
159 : :
160 : : static PyObject *
161 : : _abc_get_cache_token_impl(PyObject *module);
162 : :
163 : : static PyObject *
164 : 0 : _abc_get_cache_token(PyObject *module, PyObject *Py_UNUSED(ignored))
165 : : {
166 : 0 : return _abc_get_cache_token_impl(module);
167 : : }
168 : : /*[clinic end generated code: output=c2e69611a495c98d input=a9049054013a1b77]*/
|