Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 1 | /*[clinic input] |
| 2 | preserve |
| 3 | [clinic start generated code]*/ |
| 4 | |
| 5 | PyDoc_STRVAR(array_array___copy____doc__, |
| 6 | "__copy__($self, /)\n" |
| 7 | "--\n" |
| 8 | "\n" |
| 9 | "Return a copy of the array."); |
| 10 | |
| 11 | #define ARRAY_ARRAY___COPY___METHODDEF \ |
| 12 | {"__copy__", (PyCFunction)array_array___copy__, METH_NOARGS, array_array___copy____doc__}, |
| 13 | |
| 14 | static PyObject * |
| 15 | array_array___copy___impl(arrayobject *self); |
| 16 | |
| 17 | static PyObject * |
| 18 | array_array___copy__(arrayobject *self, PyObject *Py_UNUSED(ignored)) |
| 19 | { |
| 20 | return array_array___copy___impl(self); |
| 21 | } |
| 22 | |
| 23 | PyDoc_STRVAR(array_array___deepcopy____doc__, |
| 24 | "__deepcopy__($self, unused, /)\n" |
| 25 | "--\n" |
| 26 | "\n" |
| 27 | "Return a copy of the array."); |
| 28 | |
| 29 | #define ARRAY_ARRAY___DEEPCOPY___METHODDEF \ |
| 30 | {"__deepcopy__", (PyCFunction)array_array___deepcopy__, METH_O, array_array___deepcopy____doc__}, |
| 31 | |
| 32 | PyDoc_STRVAR(array_array_count__doc__, |
| 33 | "count($self, v, /)\n" |
| 34 | "--\n" |
| 35 | "\n" |
| 36 | "Return number of occurrences of v in the array."); |
| 37 | |
| 38 | #define ARRAY_ARRAY_COUNT_METHODDEF \ |
| 39 | {"count", (PyCFunction)array_array_count, METH_O, array_array_count__doc__}, |
| 40 | |
| 41 | PyDoc_STRVAR(array_array_index__doc__, |
| 42 | "index($self, v, /)\n" |
| 43 | "--\n" |
| 44 | "\n" |
| 45 | "Return index of first occurrence of v in the array."); |
| 46 | |
| 47 | #define ARRAY_ARRAY_INDEX_METHODDEF \ |
| 48 | {"index", (PyCFunction)array_array_index, METH_O, array_array_index__doc__}, |
| 49 | |
| 50 | PyDoc_STRVAR(array_array_remove__doc__, |
| 51 | "remove($self, v, /)\n" |
| 52 | "--\n" |
| 53 | "\n" |
| 54 | "Remove the first occurrence of v in the array."); |
| 55 | |
| 56 | #define ARRAY_ARRAY_REMOVE_METHODDEF \ |
| 57 | {"remove", (PyCFunction)array_array_remove, METH_O, array_array_remove__doc__}, |
| 58 | |
| 59 | PyDoc_STRVAR(array_array_pop__doc__, |
| 60 | "pop($self, i=-1, /)\n" |
| 61 | "--\n" |
| 62 | "\n" |
| 63 | "Return the i-th element and delete it from the array.\n" |
| 64 | "\n" |
| 65 | "i defaults to -1."); |
| 66 | |
| 67 | #define ARRAY_ARRAY_POP_METHODDEF \ |
| 68 | {"pop", (PyCFunction)array_array_pop, METH_VARARGS, array_array_pop__doc__}, |
| 69 | |
| 70 | static PyObject * |
| 71 | array_array_pop_impl(arrayobject *self, Py_ssize_t i); |
| 72 | |
| 73 | static PyObject * |
| 74 | array_array_pop(arrayobject *self, PyObject *args) |
| 75 | { |
| 76 | PyObject *return_value = NULL; |
| 77 | Py_ssize_t i = -1; |
| 78 | |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 79 | if (!PyArg_ParseTuple(args, "|n:pop", |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 80 | &i)) |
| 81 | goto exit; |
| 82 | return_value = array_array_pop_impl(self, i); |
| 83 | |
| 84 | exit: |
| 85 | return return_value; |
| 86 | } |
| 87 | |
| 88 | PyDoc_STRVAR(array_array_extend__doc__, |
| 89 | "extend($self, bb, /)\n" |
| 90 | "--\n" |
| 91 | "\n" |
| 92 | "Append items to the end of the array."); |
| 93 | |
| 94 | #define ARRAY_ARRAY_EXTEND_METHODDEF \ |
| 95 | {"extend", (PyCFunction)array_array_extend, METH_O, array_array_extend__doc__}, |
| 96 | |
| 97 | PyDoc_STRVAR(array_array_insert__doc__, |
| 98 | "insert($self, i, v, /)\n" |
| 99 | "--\n" |
| 100 | "\n" |
| 101 | "Insert a new item v into the array before position i."); |
| 102 | |
| 103 | #define ARRAY_ARRAY_INSERT_METHODDEF \ |
| 104 | {"insert", (PyCFunction)array_array_insert, METH_VARARGS, array_array_insert__doc__}, |
| 105 | |
| 106 | static PyObject * |
| 107 | array_array_insert_impl(arrayobject *self, Py_ssize_t i, PyObject *v); |
| 108 | |
| 109 | static PyObject * |
| 110 | array_array_insert(arrayobject *self, PyObject *args) |
| 111 | { |
| 112 | PyObject *return_value = NULL; |
| 113 | Py_ssize_t i; |
| 114 | PyObject *v; |
| 115 | |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 116 | if (!PyArg_ParseTuple(args, "nO:insert", |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 117 | &i, &v)) |
| 118 | goto exit; |
| 119 | return_value = array_array_insert_impl(self, i, v); |
| 120 | |
| 121 | exit: |
| 122 | return return_value; |
| 123 | } |
| 124 | |
| 125 | PyDoc_STRVAR(array_array_buffer_info__doc__, |
| 126 | "buffer_info($self, /)\n" |
| 127 | "--\n" |
| 128 | "\n" |
| 129 | "Return a tuple (address, length) giving the current memory address and the length in items of the buffer used to hold array\'s contents.\n" |
| 130 | "\n" |
| 131 | "The length should be multiplied by the itemsize attribute to calculate\n" |
| 132 | "the buffer length in bytes."); |
| 133 | |
| 134 | #define ARRAY_ARRAY_BUFFER_INFO_METHODDEF \ |
| 135 | {"buffer_info", (PyCFunction)array_array_buffer_info, METH_NOARGS, array_array_buffer_info__doc__}, |
| 136 | |
| 137 | static PyObject * |
| 138 | array_array_buffer_info_impl(arrayobject *self); |
| 139 | |
| 140 | static PyObject * |
| 141 | array_array_buffer_info(arrayobject *self, PyObject *Py_UNUSED(ignored)) |
| 142 | { |
| 143 | return array_array_buffer_info_impl(self); |
| 144 | } |
| 145 | |
| 146 | PyDoc_STRVAR(array_array_append__doc__, |
| 147 | "append($self, v, /)\n" |
| 148 | "--\n" |
| 149 | "\n" |
| 150 | "Append new value v to the end of the array."); |
| 151 | |
| 152 | #define ARRAY_ARRAY_APPEND_METHODDEF \ |
| 153 | {"append", (PyCFunction)array_array_append, METH_O, array_array_append__doc__}, |
| 154 | |
| 155 | PyDoc_STRVAR(array_array_byteswap__doc__, |
| 156 | "byteswap($self, /)\n" |
| 157 | "--\n" |
| 158 | "\n" |
| 159 | "Byteswap all items of the array.\n" |
| 160 | "\n" |
| 161 | "If the items in the array are not 1, 2, 4, or 8 bytes in size, RuntimeError is\n" |
| 162 | "raised."); |
| 163 | |
| 164 | #define ARRAY_ARRAY_BYTESWAP_METHODDEF \ |
| 165 | {"byteswap", (PyCFunction)array_array_byteswap, METH_NOARGS, array_array_byteswap__doc__}, |
| 166 | |
| 167 | static PyObject * |
| 168 | array_array_byteswap_impl(arrayobject *self); |
| 169 | |
| 170 | static PyObject * |
| 171 | array_array_byteswap(arrayobject *self, PyObject *Py_UNUSED(ignored)) |
| 172 | { |
| 173 | return array_array_byteswap_impl(self); |
| 174 | } |
| 175 | |
| 176 | PyDoc_STRVAR(array_array_reverse__doc__, |
| 177 | "reverse($self, /)\n" |
| 178 | "--\n" |
| 179 | "\n" |
| 180 | "Reverse the order of the items in the array."); |
| 181 | |
| 182 | #define ARRAY_ARRAY_REVERSE_METHODDEF \ |
| 183 | {"reverse", (PyCFunction)array_array_reverse, METH_NOARGS, array_array_reverse__doc__}, |
| 184 | |
| 185 | static PyObject * |
| 186 | array_array_reverse_impl(arrayobject *self); |
| 187 | |
| 188 | static PyObject * |
| 189 | array_array_reverse(arrayobject *self, PyObject *Py_UNUSED(ignored)) |
| 190 | { |
| 191 | return array_array_reverse_impl(self); |
| 192 | } |
| 193 | |
| 194 | PyDoc_STRVAR(array_array_fromfile__doc__, |
| 195 | "fromfile($self, f, n, /)\n" |
| 196 | "--\n" |
| 197 | "\n" |
| 198 | "Read n objects from the file object f and append them to the end of the array."); |
| 199 | |
| 200 | #define ARRAY_ARRAY_FROMFILE_METHODDEF \ |
| 201 | {"fromfile", (PyCFunction)array_array_fromfile, METH_VARARGS, array_array_fromfile__doc__}, |
| 202 | |
| 203 | static PyObject * |
| 204 | array_array_fromfile_impl(arrayobject *self, PyObject *f, Py_ssize_t n); |
| 205 | |
| 206 | static PyObject * |
| 207 | array_array_fromfile(arrayobject *self, PyObject *args) |
| 208 | { |
| 209 | PyObject *return_value = NULL; |
| 210 | PyObject *f; |
| 211 | Py_ssize_t n; |
| 212 | |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 213 | if (!PyArg_ParseTuple(args, "On:fromfile", |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 214 | &f, &n)) |
| 215 | goto exit; |
| 216 | return_value = array_array_fromfile_impl(self, f, n); |
| 217 | |
| 218 | exit: |
| 219 | return return_value; |
| 220 | } |
| 221 | |
| 222 | PyDoc_STRVAR(array_array_tofile__doc__, |
| 223 | "tofile($self, f, /)\n" |
| 224 | "--\n" |
| 225 | "\n" |
| 226 | "Write all items (as machine values) to the file object f."); |
| 227 | |
| 228 | #define ARRAY_ARRAY_TOFILE_METHODDEF \ |
| 229 | {"tofile", (PyCFunction)array_array_tofile, METH_O, array_array_tofile__doc__}, |
| 230 | |
| 231 | PyDoc_STRVAR(array_array_fromlist__doc__, |
| 232 | "fromlist($self, list, /)\n" |
| 233 | "--\n" |
| 234 | "\n" |
| 235 | "Append items to array from list."); |
| 236 | |
| 237 | #define ARRAY_ARRAY_FROMLIST_METHODDEF \ |
| 238 | {"fromlist", (PyCFunction)array_array_fromlist, METH_O, array_array_fromlist__doc__}, |
| 239 | |
| 240 | PyDoc_STRVAR(array_array_tolist__doc__, |
| 241 | "tolist($self, /)\n" |
| 242 | "--\n" |
| 243 | "\n" |
| 244 | "Convert array to an ordinary list with the same items."); |
| 245 | |
| 246 | #define ARRAY_ARRAY_TOLIST_METHODDEF \ |
| 247 | {"tolist", (PyCFunction)array_array_tolist, METH_NOARGS, array_array_tolist__doc__}, |
| 248 | |
| 249 | static PyObject * |
| 250 | array_array_tolist_impl(arrayobject *self); |
| 251 | |
| 252 | static PyObject * |
| 253 | array_array_tolist(arrayobject *self, PyObject *Py_UNUSED(ignored)) |
| 254 | { |
| 255 | return array_array_tolist_impl(self); |
| 256 | } |
| 257 | |
| 258 | PyDoc_STRVAR(array_array_fromstring__doc__, |
| 259 | "fromstring($self, buffer, /)\n" |
| 260 | "--\n" |
| 261 | "\n" |
| 262 | "Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method).\n" |
| 263 | "\n" |
| 264 | "This method is deprecated. Use frombytes instead."); |
| 265 | |
| 266 | #define ARRAY_ARRAY_FROMSTRING_METHODDEF \ |
Serhiy Storchaka | 92e8af6 | 2015-04-04 00:12:11 +0300 | [diff] [blame] | 267 | {"fromstring", (PyCFunction)array_array_fromstring, METH_O, array_array_fromstring__doc__}, |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 268 | |
| 269 | static PyObject * |
| 270 | array_array_fromstring_impl(arrayobject *self, Py_buffer *buffer); |
| 271 | |
| 272 | static PyObject * |
Serhiy Storchaka | 92e8af6 | 2015-04-04 00:12:11 +0300 | [diff] [blame] | 273 | array_array_fromstring(arrayobject *self, PyObject *arg) |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 274 | { |
| 275 | PyObject *return_value = NULL; |
| 276 | Py_buffer buffer = {NULL, NULL}; |
| 277 | |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 278 | if (!PyArg_Parse(arg, "s*:fromstring", &buffer)) |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 279 | goto exit; |
| 280 | return_value = array_array_fromstring_impl(self, &buffer); |
| 281 | |
| 282 | exit: |
| 283 | /* Cleanup for buffer */ |
| 284 | if (buffer.obj) |
| 285 | PyBuffer_Release(&buffer); |
| 286 | |
| 287 | return return_value; |
| 288 | } |
| 289 | |
| 290 | PyDoc_STRVAR(array_array_frombytes__doc__, |
| 291 | "frombytes($self, buffer, /)\n" |
| 292 | "--\n" |
| 293 | "\n" |
| 294 | "Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method)."); |
| 295 | |
| 296 | #define ARRAY_ARRAY_FROMBYTES_METHODDEF \ |
Serhiy Storchaka | 92e8af6 | 2015-04-04 00:12:11 +0300 | [diff] [blame] | 297 | {"frombytes", (PyCFunction)array_array_frombytes, METH_O, array_array_frombytes__doc__}, |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 298 | |
| 299 | static PyObject * |
| 300 | array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer); |
| 301 | |
| 302 | static PyObject * |
Serhiy Storchaka | 92e8af6 | 2015-04-04 00:12:11 +0300 | [diff] [blame] | 303 | array_array_frombytes(arrayobject *self, PyObject *arg) |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 304 | { |
| 305 | PyObject *return_value = NULL; |
| 306 | Py_buffer buffer = {NULL, NULL}; |
| 307 | |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 308 | if (!PyArg_Parse(arg, "y*:frombytes", &buffer)) |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 309 | goto exit; |
| 310 | return_value = array_array_frombytes_impl(self, &buffer); |
| 311 | |
| 312 | exit: |
| 313 | /* Cleanup for buffer */ |
| 314 | if (buffer.obj) |
| 315 | PyBuffer_Release(&buffer); |
| 316 | |
| 317 | return return_value; |
| 318 | } |
| 319 | |
| 320 | PyDoc_STRVAR(array_array_tobytes__doc__, |
| 321 | "tobytes($self, /)\n" |
| 322 | "--\n" |
| 323 | "\n" |
| 324 | "Convert the array to an array of machine values and return the bytes representation."); |
| 325 | |
| 326 | #define ARRAY_ARRAY_TOBYTES_METHODDEF \ |
| 327 | {"tobytes", (PyCFunction)array_array_tobytes, METH_NOARGS, array_array_tobytes__doc__}, |
| 328 | |
| 329 | static PyObject * |
| 330 | array_array_tobytes_impl(arrayobject *self); |
| 331 | |
| 332 | static PyObject * |
| 333 | array_array_tobytes(arrayobject *self, PyObject *Py_UNUSED(ignored)) |
| 334 | { |
| 335 | return array_array_tobytes_impl(self); |
| 336 | } |
| 337 | |
| 338 | PyDoc_STRVAR(array_array_tostring__doc__, |
| 339 | "tostring($self, /)\n" |
| 340 | "--\n" |
| 341 | "\n" |
| 342 | "Convert the array to an array of machine values and return the bytes representation.\n" |
| 343 | "\n" |
| 344 | "This method is deprecated. Use tobytes instead."); |
| 345 | |
| 346 | #define ARRAY_ARRAY_TOSTRING_METHODDEF \ |
| 347 | {"tostring", (PyCFunction)array_array_tostring, METH_NOARGS, array_array_tostring__doc__}, |
| 348 | |
| 349 | static PyObject * |
| 350 | array_array_tostring_impl(arrayobject *self); |
| 351 | |
| 352 | static PyObject * |
| 353 | array_array_tostring(arrayobject *self, PyObject *Py_UNUSED(ignored)) |
| 354 | { |
| 355 | return array_array_tostring_impl(self); |
| 356 | } |
| 357 | |
| 358 | PyDoc_STRVAR(array_array_fromunicode__doc__, |
| 359 | "fromunicode($self, ustr, /)\n" |
| 360 | "--\n" |
| 361 | "\n" |
| 362 | "Extends this array with data from the unicode string ustr.\n" |
| 363 | "\n" |
| 364 | "The array must be a unicode type array; otherwise a ValueError is raised.\n" |
| 365 | "Use array.frombytes(ustr.encode(...)) to append Unicode data to an array of\n" |
| 366 | "some other type."); |
| 367 | |
| 368 | #define ARRAY_ARRAY_FROMUNICODE_METHODDEF \ |
Serhiy Storchaka | 92e8af6 | 2015-04-04 00:12:11 +0300 | [diff] [blame] | 369 | {"fromunicode", (PyCFunction)array_array_fromunicode, METH_O, array_array_fromunicode__doc__}, |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 370 | |
| 371 | static PyObject * |
Larry Hastings | 89964c4 | 2015-04-14 18:07:59 -0400 | [diff] [blame] | 372 | array_array_fromunicode_impl(arrayobject *self, Py_UNICODE *ustr, |
| 373 | Py_ssize_clean_t ustr_length); |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 374 | |
| 375 | static PyObject * |
Serhiy Storchaka | 92e8af6 | 2015-04-04 00:12:11 +0300 | [diff] [blame] | 376 | array_array_fromunicode(arrayobject *self, PyObject *arg) |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 377 | { |
| 378 | PyObject *return_value = NULL; |
| 379 | Py_UNICODE *ustr; |
| 380 | Py_ssize_clean_t ustr_length; |
| 381 | |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 382 | if (!PyArg_Parse(arg, "u#:fromunicode", &ustr, &ustr_length)) |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 383 | goto exit; |
| 384 | return_value = array_array_fromunicode_impl(self, ustr, ustr_length); |
| 385 | |
| 386 | exit: |
| 387 | return return_value; |
| 388 | } |
| 389 | |
| 390 | PyDoc_STRVAR(array_array_tounicode__doc__, |
| 391 | "tounicode($self, /)\n" |
| 392 | "--\n" |
| 393 | "\n" |
| 394 | "Extends this array with data from the unicode string ustr.\n" |
| 395 | "\n" |
| 396 | "Convert the array to a unicode string. The array must be a unicode type array;\n" |
| 397 | "otherwise a ValueError is raised. Use array.tobytes().decode() to obtain a\n" |
| 398 | "unicode string from an array of some other type."); |
| 399 | |
| 400 | #define ARRAY_ARRAY_TOUNICODE_METHODDEF \ |
| 401 | {"tounicode", (PyCFunction)array_array_tounicode, METH_NOARGS, array_array_tounicode__doc__}, |
| 402 | |
| 403 | static PyObject * |
| 404 | array_array_tounicode_impl(arrayobject *self); |
| 405 | |
| 406 | static PyObject * |
| 407 | array_array_tounicode(arrayobject *self, PyObject *Py_UNUSED(ignored)) |
| 408 | { |
| 409 | return array_array_tounicode_impl(self); |
| 410 | } |
| 411 | |
| 412 | PyDoc_STRVAR(array_array___sizeof____doc__, |
| 413 | "__sizeof__($self, /)\n" |
| 414 | "--\n" |
| 415 | "\n" |
| 416 | "Size of the array in memory, in bytes."); |
| 417 | |
| 418 | #define ARRAY_ARRAY___SIZEOF___METHODDEF \ |
| 419 | {"__sizeof__", (PyCFunction)array_array___sizeof__, METH_NOARGS, array_array___sizeof____doc__}, |
| 420 | |
| 421 | static PyObject * |
| 422 | array_array___sizeof___impl(arrayobject *self); |
| 423 | |
| 424 | static PyObject * |
| 425 | array_array___sizeof__(arrayobject *self, PyObject *Py_UNUSED(ignored)) |
| 426 | { |
| 427 | return array_array___sizeof___impl(self); |
| 428 | } |
| 429 | |
| 430 | PyDoc_STRVAR(array__array_reconstructor__doc__, |
| 431 | "_array_reconstructor($module, arraytype, typecode, mformat_code, items,\n" |
| 432 | " /)\n" |
| 433 | "--\n" |
| 434 | "\n" |
| 435 | "Internal. Used for pickling support."); |
| 436 | |
| 437 | #define ARRAY__ARRAY_RECONSTRUCTOR_METHODDEF \ |
| 438 | {"_array_reconstructor", (PyCFunction)array__array_reconstructor, METH_VARARGS, array__array_reconstructor__doc__}, |
| 439 | |
| 440 | static PyObject * |
Larry Hastings | 89964c4 | 2015-04-14 18:07:59 -0400 | [diff] [blame] | 441 | array__array_reconstructor_impl(PyModuleDef *module, PyTypeObject *arraytype, |
| 442 | int typecode, |
| 443 | enum machine_format_code mformat_code, |
| 444 | PyObject *items); |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 445 | |
| 446 | static PyObject * |
| 447 | array__array_reconstructor(PyModuleDef *module, PyObject *args) |
| 448 | { |
| 449 | PyObject *return_value = NULL; |
| 450 | PyTypeObject *arraytype; |
| 451 | int typecode; |
Larry Hastings | dfbeb16 | 2014-10-13 10:39:41 +0100 | [diff] [blame] | 452 | enum machine_format_code mformat_code; |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 453 | PyObject *items; |
| 454 | |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 455 | if (!PyArg_ParseTuple(args, "OCiO:_array_reconstructor", |
Brett Cannon | 1eb32c2 | 2014-10-10 16:26:45 -0400 | [diff] [blame] | 456 | &arraytype, &typecode, &mformat_code, &items)) |
| 457 | goto exit; |
| 458 | return_value = array__array_reconstructor_impl(module, arraytype, typecode, mformat_code, items); |
| 459 | |
| 460 | exit: |
| 461 | return return_value; |
| 462 | } |
| 463 | |
| 464 | PyDoc_STRVAR(array_array___reduce_ex____doc__, |
| 465 | "__reduce_ex__($self, value, /)\n" |
| 466 | "--\n" |
| 467 | "\n" |
| 468 | "Return state information for pickling."); |
| 469 | |
| 470 | #define ARRAY_ARRAY___REDUCE_EX___METHODDEF \ |
| 471 | {"__reduce_ex__", (PyCFunction)array_array___reduce_ex__, METH_O, array_array___reduce_ex____doc__}, |
| 472 | |
| 473 | PyDoc_STRVAR(array_arrayiterator___reduce____doc__, |
| 474 | "__reduce__($self, /)\n" |
| 475 | "--\n" |
| 476 | "\n" |
| 477 | "Return state information for pickling."); |
| 478 | |
| 479 | #define ARRAY_ARRAYITERATOR___REDUCE___METHODDEF \ |
| 480 | {"__reduce__", (PyCFunction)array_arrayiterator___reduce__, METH_NOARGS, array_arrayiterator___reduce____doc__}, |
| 481 | |
| 482 | static PyObject * |
| 483 | array_arrayiterator___reduce___impl(arrayiterobject *self); |
| 484 | |
| 485 | static PyObject * |
| 486 | array_arrayiterator___reduce__(arrayiterobject *self, PyObject *Py_UNUSED(ignored)) |
| 487 | { |
| 488 | return array_arrayiterator___reduce___impl(self); |
| 489 | } |
| 490 | |
| 491 | PyDoc_STRVAR(array_arrayiterator___setstate____doc__, |
| 492 | "__setstate__($self, state, /)\n" |
| 493 | "--\n" |
| 494 | "\n" |
| 495 | "Set state information for unpickling."); |
| 496 | |
| 497 | #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF \ |
| 498 | {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, |
Serhiy Storchaka | 247789c | 2015-04-24 00:40:51 +0300 | [diff] [blame] | 499 | /*[clinic end generated code: output=d2e82c65ea841cfc input=a9049054013a1b77]*/ |