8000 gh-81313: Add the intmath module (PEP-791) by serhiy-storchaka · Pull Request #133909 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-81313: Add the intmath module (PEP-791) #133909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Support multiple interpreters.
  • Loading branch information
serhiy-storchaka committed May 12, 2025
commit 091dab6f18299e52c4dfc8a7107bc0e233a72bde
9 changes: 7 additions & 2 deletions Modules/imathmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -1277,21 +1277,26 @@ static PyMethodDef imath_methods[] = {
{NULL, NULL} /* sentinel */
};

static PyModuleDef_Slot imath_slots[] = {
{Py_mod_multiple_interpreters, Py_MOD_PER_INTERPRETER_GIL_SUPPORTED},
{Py_mod_gil, Py_MOD_GIL_NOT_USED},
{0, NULL}
};

PyDoc_STRVAR(module_doc,
"This module provides access to integer related mathematical functions.");


static struct PyModuleDef imathmodule = {
PyModuleDef_HEAD_INIT,
.m_name = "imath",
.m_doc = module_doc,
.m_size = 0,
.m_methods = imath_methods,
.m_slots = imath_slots,
};

PyMODINIT_FUNC
PyInit_imath(void)
{
return PyModule_Create(&imathmodule);
return PyModuleDef_Init(&imathmodule);
}
Loading
0