@@ -136,14 +136,14 @@ Importing Modules
136
136
such modules have no way to know that the module object is an unknown (and
137
137
probably damaged with respect to the module author's intents) state.
138
138
139
- The module's :attr:`__spec__` and :attr:`__loader__` will be set, if
140
- not set already, with the appropriate values. The spec's loader will
141
- be set to the module's `` __loader__`` (if set) and to an instance of
142
- :class:`~importlib.machinery.SourceFileLoader` otherwise.
139
+ The module's :attr:`~module. __spec__` and :attr:`~module. __loader__` will be
140
+ set, if not set already, with the appropriate values. The spec's loader
141
+ will be set to the module's :attr:`! __loader__` (if set) and to an instance
142
+ of :class:`~importlib.machinery.SourceFileLoader` otherwise.
143
143
144
- The module's :attr:`__file__` attribute will be set to the code object's
145
- :attr:`~codeobject.co_filename`. If applicable, :attr:`__cached__` will also
146
- be set.
144
+ The module's :attr:`~module. __file__` attribute will be set to the code
145
+ object's :attr:`~codeobject.co_filename`. If applicable,
146
+ :attr:`~module.__cached__` will also be set.
147
147
148
148
This function will reload the module if it was already imported. See
149
149
:c:func:`PyImport_ReloadModule` for the intended way to reload a module.
@@ -155,29 +155,29 @@ Importing Modules
155
155
:c:func:`PyImport_ExecCodeModuleWithPathnames`.
156
156
157
157
.. versionchanged:: 3.12
158
- The setting of :attr:`__cached__` and :attr:`__loader__` is
159
- deprecated. See :class:`~importlib.machinery.ModuleSpec` for
158
+ The setting of :attr:`~module. __cached__` and :attr:`~module. __loader__`
159
+ is deprecated. See :class:`~importlib.machinery.ModuleSpec` for
160
160
alternatives.
161
161
162
162
163
163
.. c:function:: PyObject* PyImport_ExecCodeModuleEx(const char *name, PyObject *co, const char *pathname)
164
164
165
- Like :c:func: `PyImport_ExecCodeModule `, but the :attr: `__file__ ` attribute of
166
- the module object is set to *pathname * if it is non-``NULL ``.
165
+ Like :c:func: `PyImport_ExecCodeModule `, but the :attr: `~module. __file__ `
166
+ attribute of the module object is set to *pathname * if it is non-``NULL ``.
167
167
168
168
See also :c:func: `PyImport_ExecCodeModuleWithPathnames `.
169
169
170
170
171
171
.. c :function :: PyObject* PyImport_ExecCodeModuleObject (PyObject *name, PyObject *co, PyObject *pathname, PyObject *cpathname)
172
172
173
- Like :c:func: `PyImport_ExecCodeModuleEx `, but the :attr: `__cached__ `
173
+ Like :c:func: `PyImport_ExecCodeModuleEx `, but the :attr: `~module. __cached__ `
174
174
attribute of the module object is set to *cpathname * if it is
175
175
non-``NULL ``. Of the three functions, this is the preferred one to use.
176
176
177
177
.. versionadded :: 3.3
178
178
179
179
.. versionchanged :: 3.12
180
- Setting :attr: `__cached__ ` is deprecated. See
180
+ Setting :attr: `~module. __cached__ ` is deprecated. See
181
181
:class: `~importlib.machinery.ModuleSpec ` for alternatives.
182
182
183
183
0 commit comments