MCPcopy Create free account
hub / github.com/arximboldi/immer / module_init

Function module_init

extra/python/src/immer-raw.cpp:357–376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

355PyMethodDef module_methods[] = {{0, 0, 0, 0}};
356
357PyObject* 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

Callers 2

initimmer_python_moduleFunction · 0.85

Calls 1

make_vectorFunction · 0.85

Tested by

no test coverage detected