Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Multi-phase module initialisation (PEP 489) #1715
Comments
scoder
added Code Generation enhancement
labels
May 25, 2017
This was referenced May 29, 2017
|
Implemented in #1794 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
scoder commentedMay 25, 2017
•
edited
CPython 3.5 introduced a new module initialisation scheme in multiple phases:
https://www.python.org/dev/peps/pep-0489/
This improves the support for extension module reloading and could also allow running extension modules as main module (
python -m) in the future (probably Py3.7).Worth implementing. It requires splitting up the
generate_module_init_func()method in https://github.com/cython/cython/blob/master/Cython/Compiler/ModuleNode.py to generate separate functions for the separate phases, and then also to find a compatible fallback way to execute them in older Python versions.The proposed CPython support for runnable extension modules is tracked here: https://bugs.python.org/issue30403