diff options
author | Eric Snow <ericsnowcurrently@gmail.com> | 2014-05-12 23:54:55 (GMT) |
---|---|---|
committer | Eric Snow <ericsnowcurrently@gmail.com> | 2014-05-12 23:54:55 (GMT) |
commit | 08197a4616f6294e21672fd8ebb5da7ce956c8e5 (patch) | |
tree | f288f00937c5fbb449f7edfb782654aee38dea64 /Doc | |
parent | 0cc45baa3d160810f371ef7b69f4b56437bde790 (diff) | |
download | cpython-08197a4616f6294e21672fd8ebb5da7ce956c8e5.zip cpython-08197a4616f6294e21672fd8ebb5da7ce956c8e5.tar.gz cpython-08197a4616f6294e21672fd8ebb5da7ce956c8e5.tar.bz2 |
Issue #21226: Set all attrs in PyImport_ExecCodeModuleObject.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/c-api/import.rst | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst index 0dcac2d..3641fc6 100644 --- a/Doc/c-api/import.rst +++ b/Doc/c-api/import.rst @@ -132,8 +132,14 @@ Importing Modules such modules have no way to know that the module object is an unknown (and probably damaged with respect to the module author's intents) state. + The module's :attr:`__spec__` and :attr:`__loader__` will be set, if + not set already, with the appropriate values. The spec's loader will + be set to the module's ``__loader__`` (if set) and to an instance of + :class:`SourceFileLoader` otherwise. + The module's :attr:`__file__` attribute will be set to the code object's - :c:member:`co_filename`. + :c:member:`co_filename`. If applicable, :attr:`__cached__` will also + be set. This function will reload the module if it was already imported. See :c:func:`PyImport_ReloadModule` for the intended way to reload a module. |