| 355 | PyMethodDef module_methods[] = {{0, 0, 0, 0}}; |
| 356 | |
| 357 | PyObject* module_init() |
| 358 | { |
| 359 | if (PyType_Ready(&vector_t::type) < 0) |
| 360 | return nullptr; |
| 361 | |
| 362 | #if PY_MAJOR_VERSION >= 3 |
| 363 | auto m = PyModule_Create(&module_def); |
| 364 | #else |
| 365 | auto m = Py_InitModule3("immer_python_module", module_methods, ""); |
| 366 | #endif |
| 367 | if (!m) |
| 368 | return nullptr; |
| 369 | |
| 370 | if (!empty_vector) |
| 371 | empty_vector = make_vector(); |
| 372 | |
| 373 | Py_INCREF(&vector_t::type); |
| 374 | PyModule_AddObject(m, "Vector", (PyObject*) &vector_t::type); |
| 375 | return m; |
| 376 | } |
| 377 | |
| 378 | } // anonymous namespace |
| 379 |
no test coverage detected