comparison Modules/arraymodule.c @ 23365:3efd34fe6668 legacy-trunk

Indicate delayed initialization of slots. Suggested by tim.one.
author Martin v. Löwis <martin@v.loewis.de>
date Thu, 02 May 2002 20:34:12 +0000
parents 18f8a7b56f89
children fb64f21176af
comparison
equal deleted inserted replaced
23364:bec157dbee2e 23365:3efd34fe6668
10 #else /* !STDC_HEADERS */ 10 #else /* !STDC_HEADERS */
11 #ifndef DONT_HAVE_SYS_TYPES_H 11 #ifndef DONT_HAVE_SYS_TYPES_H
12 #include <sys/types.h> /* For size_t */ 12 #include <sys/types.h> /* For size_t */
13 #endif /* DONT_HAVE_SYS_TYPES_H */ 13 #endif /* DONT_HAVE_SYS_TYPES_H */
14 #endif /* !STDC_HEADERS */ 14 #endif /* !STDC_HEADERS */
15
16 #define DELAYED(X) 0
15 17
16 struct arrayobject; /* Forward */ 18 struct arrayobject; /* Forward */
17 19
18 /* All possible arraydescr values are defined in the vector "descriptors" 20 /* All possible arraydescr values are defined in the vector "descriptors"
19 * below. That's defined later because the appropriate get and set 21 * below. That's defined later because the appropriate get and set
1695 &array_as_sequence, /* tp_as _sequence*/ 1697 &array_as_sequence, /* tp_as _sequence*/
1696 0, /* tp_as _mapping*/ 1698 0, /* tp_as _mapping*/
1697 0, /* tp_hash */ 1699 0, /* tp_hash */
1698 0, /* tp_call */ 1700 0, /* tp_call */
1699 0, /* tp_str */ 1701 0, /* tp_str */
1700 0, /* tp_getattro */ 1702 DELAYED(PyObject_GenericGetAttr), /* tp_getattro */
1701 0, /* tp_setattro */ 1703 0, /* tp_setattro */
1702 &array_as_buffer, /* tp_as_buffer*/ 1704 &array_as_buffer, /* tp_as_buffer*/
1703 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ 1705 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */
1704 arraytype_doc, /* tp_doc */ 1706 arraytype_doc, /* tp_doc */
1705 0, /* tp_traverse */ 1707 0, /* tp_traverse */
1715 0, /* tp_dict */ 1717 0, /* tp_dict */
1716 0, /* tp_descr_get */ 1718 0, /* tp_descr_get */
1717 0, /* tp_descr_set */ 1719 0, /* tp_descr_set */
1718 0, /* tp_dictoffset */ 1720 0, /* tp_dictoffset */
1719 0, /* tp_init */ 1721 0, /* tp_init */
1720 0, /* tp_alloc */ 1722 DELAYED(PyType_GenericAlloc), /* tp_alloc */
1721 array_new, /* tp_new */ 1723 array_new, /* tp_new */
1722 0, /* tp_free */ 1724 DELAYED(PyObject_Del), /* tp_free */
1723 }; 1725 };
1724 1726
1725 /* No functions in array module. */ 1727 /* No functions in array module. */
1726 static PyMethodDef a_methods[] = { 1728 static PyMethodDef a_methods[] = {
1727 {NULL, NULL, 0, NULL} /* Sentinel */ 1729 {NULL, NULL, 0, NULL} /* Sentinel */