GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||
GeezerVison is showing github.com — bpo-1635741: port _ctypes extension module to multiphase initialization by kumaraditya303 · Pull Request #30525 · python/cpython Conversation
|
| } | ||
|
|
||
| static struct PyModuleDef_Slot _ctypes_slots[] = { | ||
| {Py_mod_exec, _ctypes_mod_exec}, |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I am just curious about those codes in _ctypes_mod_exec, do we need judge the attr manually?
_unpickle = PyObject_GetAttrString(mod, "_unpickle");
if (_unpickle == NULL) {
return -1;
}
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You should not convert an extension to the multi-phase init API until all static types defined by the extension are defined as heap types.
See _ctypes_add_types(): there are many types defined as static types. Just one example: PyCArg_Type.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
True; but sadly, converting static types to heap types has been put on hold by the SC. The good news is that work is in progress to resolve the "deadlock", so we can continue applying PEP 489 and PEP 630 to the standard library 😃 See SC communications as of February 2021: "The Steering Council discussed the ongoing work on porting types in the standard library to heap-types and the subinterpreter-related changes. It was decided that through Pablo, the Steering Council will ask the core developers driving those changes to create an informational PEP and not to make any more changes in this area after beta 1, as per our general policy." |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Eric is working on a PEP: python/peps#2212 Not sure if it fulfill SC requirements to convert more static types to heap types. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
IIUC converting static types to heap types is a different issue https://bugs.python.org/issue40077 which is not I am tackling in this PR, also itertools module also creates many static types but still uses multiphase initialization cpython/Modules/itertoolsmodule.c Line 4907 in be578e0
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It is subinterpreter related. Also, we first convert global state to module state, then apply multi-phase init, as Victor already pointed out. Some modules have been converted to multi-phase init prematurely. That does not alter the status quo, or set a precedent. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
FYI, Please read https://github.com/vstinner/talks/blob/main/2021-PyconUS/subinterpreters.pdf how we've converted modules :) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Same as Victor
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.