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