Mercurial > cpython-lru_cache-weakref
diff Modules/arraymodule.c @ 23362:18f8a7b56f89 legacy-trunk
Patch #551009: Initialize array type dynamically.
| author | Martin v. Löwis <martin@v.loewis.de> |
|---|---|
| date | Thu, 02 May 2002 20:09:59 +0000 |
| parents | 72778ec94dec |
| children | 3efd34fe6668 |
line wrap: on
line diff
--- a/Modules/arraymodule.c Thu May 02 19:56:55 2002 +0000 +++ b/Modules/arraymodule.c Thu May 02 20:09:59 2002 +0000 @@ -1697,7 +1697,7 @@ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ - PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_getattro */ 0, /* tp_setattro */ &array_as_buffer, /* tp_as_buffer*/ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ @@ -1717,9 +1717,9 @@ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ 0, /* tp_init */ - PyType_GenericAlloc, /* tp_alloc */ + 0, /* tp_alloc */ array_new, /* tp_new */ - PyObject_Del, /* tp_free */ + 0, /* tp_free */ }; /* No functions in array module. */ @@ -1734,6 +1734,9 @@ PyObject *m; Arraytype.ob_type = &PyType_Type; + Arraytype.tp_getattro = PyObject_GenericGetAttr; + Arraytype.tp_alloc = PyType_GenericAlloc; + Arraytype.tp_free = PyObject_Del; m = Py_InitModule3("array", a_methods, module_doc); Py_INCREF((PyObject *)&Arraytype);
