comparison Modules/arraymodule.c @ 11711:6546ea06e157 legacy-trunk

Patch from Paul Sokolovsky <Paul.Sokolovsky@technologist.com>: Attached is patch (against 1.5.2 release) to allow some modules to be buildable as pyd's (usual &PyType_Type stuff).
author Fred Drake <fdrake@acm.org>
date Fri, 04 Feb 2000 20:33:49 +0000
parents 5e6e9e893acd
children 1c7c2dd1beb1
comparison
equal deleted inserted replaced
11710:38c4d61db7ea 11711:6546ea06e157
1446 typecode -- the typecode character used to create the array\n\ 1446 typecode -- the typecode character used to create the array\n\
1447 itemsize -- the length in bytes of one array item\n\ 1447 itemsize -- the length in bytes of one array item\n\
1448 "; 1448 ";
1449 1449
1450 statichere PyTypeObject Arraytype = { 1450 statichere PyTypeObject Arraytype = {
1451 PyObject_HEAD_INIT(&PyType_Type) 1451 PyObject_HEAD_INIT(NULL)
1452 0, 1452 0,
1453 "array", 1453 "array",
1454 sizeof(arrayobject), 1454 sizeof(arrayobject),
1455 0, 1455 0,
1456 (destructor)array_dealloc, /*tp_dealloc*/ 1456 (destructor)array_dealloc, /*tp_dealloc*/
1474 1474
1475 DL_EXPORT(void) 1475 DL_EXPORT(void)
1476 initarray() 1476 initarray()
1477 { 1477 {
1478 PyObject *m, *d; 1478 PyObject *m, *d;
1479
1480 Arraytype.ob_type = &PyType_Type;
1479 m = Py_InitModule3("array", a_methods, module_doc); 1481 m = Py_InitModule3("array", a_methods, module_doc);
1480 d = PyModule_GetDict(m); 1482 d = PyModule_GetDict(m);
1481 PyDict_SetItemString(d, "ArrayType", (PyObject *)&Arraytype); 1483 PyDict_SetItemString(d, "ArrayType", (PyObject *)&Arraytype);
1482 /* No need to check the error here, the caller will do that */ 1484 /* No need to check the error here, the caller will do that */
1483 } 1485 }