summaryrefslogtreecommitdiffstats
path: root/Doc/c-api/import.rst
diff options
context:
space:
mode:
Diffstat (limited to 'Doc/c-api/import.rst')
-rw-r--r--Doc/c-api/import.rst8
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.