1/*[clinic input]
2preserve
3[clinic start generated code]*/
4
5PyDoc_STRVAR(type___instancecheck____doc__,
6"__instancecheck__($self, instance, /)\n"
7"--\n"
8"\n"
9"Check if an object is an instance.");
10
11#define TYPE___INSTANCECHECK___METHODDEF \
12 {"__instancecheck__", (PyCFunction)type___instancecheck__, METH_O, type___instancecheck____doc__},
13
14static int
15type___instancecheck___impl(PyTypeObject *self, PyObject *instance);
16
17static PyObject *
18type___instancecheck__(PyTypeObject *self, PyObject *instance)
19{
20 PyObject *return_value = NULL;
21 int _return_value;
22
23 _return_value = type___instancecheck___impl(self, instance);
24 if ((_return_value == -1) && PyErr_Occurred()) {
25 goto exit;
26 }
27 return_value = PyBool_FromLong((long)_return_value);
28
29exit:
30 return return_value;
31}
32
33PyDoc_STRVAR(type___subclasscheck____doc__,
34"__subclasscheck__($self, subclass, /)\n"
35"--\n"
36"\n"
37"Check if a class is a subclass.");
38
39#define TYPE___SUBCLASSCHECK___METHODDEF \
40 {"__subclasscheck__", (PyCFunction)type___subclasscheck__, METH_O, type___subclasscheck____doc__},
41
42static int
43type___subclasscheck___impl(PyTypeObject *self, PyObject *subclass);
44
45static PyObject *
46type___subclasscheck__(PyTypeObject *self, PyObject *subclass)
47{
48 PyObject *return_value = NULL;
49 int _return_value;
50
51 _return_value = type___subclasscheck___impl(self, subclass);
52 if ((_return_value == -1) && PyErr_Occurred()) {
53 goto exit;
54 }
55 return_value = PyBool_FromLong((long)_return_value);
56
57exit:
58 return return_value;
59}
60
61PyDoc_STRVAR(type_mro__doc__,
62"mro($self, /)\n"
63"--\n"
64"\n"
65"Return a type\'s method resolution order.");
66
67#define TYPE_MRO_METHODDEF \
68 {"mro", (PyCFunction)type_mro, METH_NOARGS, type_mro__doc__},
69
70static PyObject *
71type_mro_impl(PyTypeObject *self);
72
73static PyObject *
74type_mro(PyTypeObject *self, PyObject *Py_UNUSED(ignored))
75{
76 return type_mro_impl(self);
77}
78
79PyDoc_STRVAR(type___subclasses____doc__,
80"__subclasses__($self, /)\n"
81"--\n"
82"\n"
83"Return a list of immediate subclasses.");
84
85#define TYPE___SUBCLASSES___METHODDEF \
86 {"__subclasses__", (PyCFunction)type___subclasses__, METH_NOARGS, type___subclasses____doc__},
87
88static PyObject *
89type___subclasses___impl(PyTypeObject *self);
90
91static PyObject *
92type___subclasses__(PyTypeObject *self, PyObject *Py_UNUSED(ignored))
93{
94 return type___subclasses___impl(self);
95}
96
97PyDoc_STRVAR(type___dir____doc__,
98"__dir__($self, /)\n"
99"--\n"
100"\n"
101"Specialized __dir__ implementation for types.");
102
103#define TYPE___DIR___METHODDEF \
104 {"__dir__", (PyCFunction)type___dir__, METH_NOARGS, type___dir____doc__},
105
106static PyObject *
107type___dir___impl(PyTypeObject *self);
108
109static PyObject *
110type___dir__(PyTypeObject *self, PyObject *Py_UNUSED(ignored))
111{
112 return type___dir___impl(self);
113}
114
115PyDoc_STRVAR(type___sizeof____doc__,
116"__sizeof__($self, /)\n"
117"--\n"
118"\n"
119"Return memory consumption of the type object.");
120
121#define TYPE___SIZEOF___METHODDEF \
122 {"__sizeof__", (PyCFunction)type___sizeof__, METH_NOARGS, type___sizeof____doc__},
123
124static PyObject *
125type___sizeof___impl(PyTypeObject *self);
126
127static PyObject *
128type___sizeof__(PyTypeObject *self, PyObject *Py_UNUSED(ignored))
129{
130 return type___sizeof___impl(self);
131}
132
133PyDoc_STRVAR(object___reduce____doc__,
134"__reduce__($self, /)\n"
135"--\n"
136"\n"
137"Helper for pickle.");
138
139#define OBJECT___REDUCE___METHODDEF \
140 {"__reduce__", (PyCFunction)object___reduce__, METH_NOARGS, object___reduce____doc__},
141
142static PyObject *
143object___reduce___impl(PyObject *self);
144
145static PyObject *
146object___reduce__(PyObject *self, PyObject *Py_UNUSED(ignored))
147{
148 return object___reduce___impl(self);
149}
150
151PyDoc_STRVAR(object___reduce_ex____doc__,
152"__reduce_ex__($self, protocol, /)\n"
153"--\n"
154"\n"
155"Helper for pickle.");
156
157#define OBJECT___REDUCE_EX___METHODDEF \
158 {"__reduce_ex__", (PyCFunction)object___reduce_ex__, METH_O, object___reduce_ex____doc__},
159
160static PyObject *
161object___reduce_ex___impl(PyObject *self, int protocol);
162
163static PyObject *
164object___reduce_ex__(PyObject *self, PyObject *arg)
165{
166 PyObject *return_value = NULL;
167 int protocol;
168
169 protocol = _PyLong_AsInt(arg);
170 if (protocol == -1 && PyErr_Occurred()) {
171 goto exit;
172 }
173 return_value = object___reduce_ex___impl(self, protocol);
174
175exit:
176 return return_value;
177}
178
179PyDoc_STRVAR(object___format____doc__,
180"__format__($self, format_spec, /)\n"
181"--\n"
182"\n"
183"Default object formatter.");
184
185#define OBJECT___FORMAT___METHODDEF \
186 {"__format__", (PyCFunction)object___format__, METH_O, object___format____doc__},
187
188static PyObject *
189object___format___impl(PyObject *self, PyObject *format_spec);
190
191static PyObject *
192object___format__(PyObject *self, PyObject *arg)
193{
194 PyObject *return_value = NULL;
195 PyObject *format_spec;
196
197 if (!PyUnicode_Check(arg)) {
198 _PyArg_BadArgument("__format__", "argument", "str", arg);
199 goto exit;
200 }
201 if (PyUnicode_READY(arg) == -1) {
202 goto exit;
203 }
204 format_spec = arg;
205 return_value = object___format___impl(self, format_spec);
206
207exit:
208 return return_value;
209}
210
211PyDoc_STRVAR(object___sizeof____doc__,
212"__sizeof__($self, /)\n"
213"--\n"
214"\n"
215"Size of object in memory, in bytes.");
216
217#define OBJECT___SIZEOF___METHODDEF \
218 {"__sizeof__", (PyCFunction)object___sizeof__, METH_NOARGS, object___sizeof____doc__},
219
220static PyObject *
221object___sizeof___impl(PyObject *self);
222
223static PyObject *
224object___sizeof__(PyObject *self, PyObject *Py_UNUSED(ignored))
225{
226 return object___sizeof___impl(self);
227}
228
229PyDoc_STRVAR(object___dir____doc__,
230"__dir__($self, /)\n"
231"--\n"
232"\n"
233"Default dir() implementation.");
234
235#define OBJECT___DIR___METHODDEF \
236 {"__dir__", (PyCFunction)object___dir__, METH_NOARGS, object___dir____doc__},
237
238static PyObject *
239object___dir___impl(PyObject *self);
240
241static PyObject *
242object___dir__(PyObject *self, PyObject *Py_UNUSED(ignored))
243{
244 return object___dir___impl(self);
245}
246/*[clinic end generated code: output=b4fb62939b08baf9 input=a9049054013a1b77]*/
247