-
Notifications
You must be signed in to change notification settings - Fork 57
Use multi-phase init #175
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
base: main
Are you sure you want to change the base?
Use multi-phase init #175
Conversation
cc @nitzmahone |
@ngoldbaum, is this part of #178 or are these PRs orthagonal? |
I think that is fine. Python changed the documentation: it used to state that mult-phase init implied module isolation, now it states that module isolation is recommended but not required. |
I see the engine choice logic is here. It seems
@arigo is that a correct assesment? If true, then I would not worry about |
I think that is fine to drop Python-2 in the c-based backend code. We keep some python2-compatible code in other places to attempt to still work with PyPy-2, but certainly the c-based backend here is only used on CPython. It might be nice to do this in a separate PR. In any case, there should be a short blurb about these changes in |
.m_base = PyModuleDef_HEAD_INIT, | ||
.m_name = "_cffi_backend", | ||
.m_size = 0, | ||
.m_methds = FFIBackendMethods, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo
.m_methds = FFIBackendMethods, | |
.m_methods = FFIBackendMethods, |
No, |
They're orthogonal. |
#174.
cc @arigo -- this is a minimal implementation for
_cffi_backend.c
. Questions:PY_VERSION
checks? It's hard to test the Python-2 case, and as far as I can tell you only support Python 3.8+.#if
branching, so I've avoided for now.PyModule_Create
) invengine_cpy.py
, but the file is marked as deprecated. Is the file still used / should I update this?_my_Py_InitModule()
andb_init_cffi_1_0_external_module()
will be tricky to migrate. Would it be possible to use the dynamic creation functions here instead?A