From 04c3060fa90bca83b4c4bb19c0c6b91de6690f92 Mon Sep 17 00:00:00 2001 From: Hai Shi Date: Sat, 18 Jan 2020 18:41:31 +0800 Subject: [PATCH 1/2] Port _bisect extension module to multiphase initialization(PEP 489) --- Modules/_bisectmodule.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c index 461a11f5099db3..1c9f9931484233 100644 --- a/Modules/_bisectmodule.c +++ b/Modules/_bisectmodule.c @@ -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 @@ -276,5 +279,5 @@ static struct PyModuleDef _bisectmodule = { PyMODINIT_FUNC PyInit__bisect(void) { - return PyModule_Create(&_bisectmodule); + return PyModuleDef_Init(&_bisectmodule); } From ac0791fa7cad4f69ed33f13d54225d230c41a780 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Sat, 18 Jan 2020 10:49:20 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Core and Builtins/2020-01-18-10-49-17.bpo-1635741.ee-6-z.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2020-01-18-10-49-17.bpo-1635741.ee-6-z.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-01-18-10-49-17.bpo-1635741.ee-6-z.rst b/Misc/NEWS.d/next/Core and Builtins/2020-01-18-10-49-17.bpo-1635741.ee-6-z.rst new file mode 100644 index 00000000000000..855009ad8769f2 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2020-01-18-10-49-17.bpo-1635741.ee-6-z.rst @@ -0,0 +1 @@ +Port _bisect extension module to multiphase initialization (:pep:`489`). \ No newline at end of file