Implement PEP 3121: new module initialization and finalization API.

This commit is contained in:
Martin v. Löwis 2008-06-11 05:26:20 +00:00
parent cdf94635d7
commit 1a21451b1d
113 changed files with 2230 additions and 855 deletions

View file

@ -226,10 +226,21 @@ having to sort the list after each insertion. For long lists of items with\n\
expensive comparison operations, this can be an improvement over the more\n\
common approach.\n");
PyMODINIT_FUNC
init_bisect(void)
{
PyObject *m;
m = Py_InitModule3("_bisect", bisect_methods, module_doc);
static struct PyModuleDef _bisectmodule = {
PyModuleDef_HEAD_INIT,
"_bisect",
module_doc,
-1,
bisect_methods,
NULL,
NULL,
NULL,
NULL
};
PyMODINIT_FUNC
PyInit__bisect(void)
{
return PyModule_Create(&_bisectmodule);
}