PEP for -m switch for extension modules#266
Merged
Conversation
DimitrisJim
reviewed
May 26, 2017
pep-9999.rst
Outdated
| the PEP 489 multi-phase initialization. | ||
|
|
||
| With this, a multi-phase initialization enabled module can be run | ||
| using following syntax:: |
Contributor
There was a problem hiding this comment.
"using following syntax" -> "using the following command"
DimitrisJim
reviewed
May 26, 2017
pep-9999.rst
Outdated
| Python's ``-m`` option. | ||
|
|
||
| The technical groundwork to make this possible has been done for PEP 489, | ||
| and enabling the ``-m`` option is listed in in that PEP's |
DimitrisJim
reviewed
May 26, 2017
pep-9999.rst
Outdated
|
|
||
| The module specified by ``-m`` is not imported normally. | ||
| Instead, it is executed in the namespace of the ``__main__`` module, | ||
| which is created quite since early in interpreter initialization. |
Contributor
There was a problem hiding this comment.
"quite since early" -> "quite early"
DimitrisJim
reviewed
May 26, 2017
pep-9999.rst
Outdated
|
|
||
| While PEP 489 was designed to make these changes generally possible, | ||
| it's necessary to decouple module discovery, creation, and initialization | ||
| steps for extension modules, so that anothe module can be used instead of |
Contributor
There was a problem hiding this comment.
you forgot the 'r' in 'anothe'
DimitrisJim
reviewed
May 26, 2017
pep-9999.rst
Outdated
| In the multi-phase initialization case, the ``PyModuleDef`` and the module to | ||
| be initialized will be passed to a new function, ``PyModule_ExecInModule``. | ||
|
|
||
| This function raise ``ImportError`` if the ``PyModuleDef`` specifies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This idea was discussed on import-sig: https://mail.python.org/pipermail/import-sig/2017-May/001072.html