Skip to content

bpo-1635741: Port _bisect extension module to multiphase initialization(PEP 489) #18049

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Port _bisect extension module to multiphase initialization (:pep:`489`).
9 changes: 6 additions & 3 deletions Modules/_bisectmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,14 +260,17 @@ 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");

static PyModuleDef_Slot _bisect_slots[] = {
{0, NULL}
};

static struct PyModuleDef _bisectmodule = {
PyModuleDef_HEAD_INIT,
"_bisect",
module_doc,
-1,
0,
bisect_methods,
NULL,
_bisect_slots,
NULL,
NULL,
NULL
Expand All @@ -276,5 +279,5 @@ static struct PyModuleDef _bisectmodule = {
PyMODINIT_FUNC
PyInit__bisect(void)
{
return PyModule_Create(&_bisectmodule);
return PyModuleDef_Init(&_bisectmodule);
}