@@ -36,7 +36,7 @@ implement import semantics.
36
36
37
37
When a module is first imported, Python searches for the module and if found,
38
38
it creates a module object [#fnmo ]_, initializing it. If the named module
39
- cannot be found, an :exc: `ModuleNotFoundError ` is raised. Python implements various
39
+ cannot be found, a :exc: `ModuleNotFoundError ` is raised. Python implements various
40
40
strategies to search for the named module when the import machinery is
41
41
invoked. These strategies can be modified and extended by using various hooks
42
42
described in the sections below.
@@ -167,7 +167,7 @@ arguments to the :keyword:`import` statement, or from the parameters to the
167
167
This name will be used in various phases of the import search, and it may be
168
168
the dotted path to a submodule, e.g. ``foo.bar.baz ``. In this case, Python
169
169
first tries to import ``foo ``, then ``foo.bar ``, and finally ``foo.bar.baz ``.
170
- If any of the intermediate imports fail, an :exc: `ModuleNotFoundError ` is raised.
170
+ If any of the intermediate imports fail, a :exc: `ModuleNotFoundError ` is raised.
171
171
172
172
173
173
The module cache
@@ -185,7 +185,7 @@ object.
185
185
186
186
During import, the module name is looked up in :data: `sys.modules ` and if
187
187
present, the associated value is the module satisfying the import, and the
188
- process completes. However, if the value is ``None ``, then an
188
+ process completes. However, if the value is ``None ``, then a
189
189
:exc: `ModuleNotFoundError ` is raised. If the module name is missing, Python will
190
190
continue searching for the module.
191
191
@@ -194,7 +194,7 @@ associated module (as other modules may hold references to it),
194
194
but it will invalidate the cache entry for the named module, causing
195
195
Python to search anew for the named module upon its next
196
196
import. The key can also be assigned to ``None ``, forcing the next import
197
- of the module to result in an :exc: `ModuleNotFoundError `.
197
+ of the module to result in a :exc: `ModuleNotFoundError `.
198
198
199
199
Beware though, as if you keep a reference to the module object,
200
200
invalidate its cache entry in :data: `sys.modules `, and then re-import the
@@ -298,7 +298,7 @@ The second argument is the path entries to use for the module search. For
298
298
top-level modules, the second argument is ``None ``, but for submodules or
299
299
subpackages, the second argument is the value of the parent package's
300
300
``__path__ `` attribute. If the appropriate ``__path__ `` attribute cannot
301
- be accessed, an :exc: `ModuleNotFoundError ` is raised. The third argument
301
+ be accessed, a :exc: `ModuleNotFoundError ` is raised. The third argument
302
302
is an existing module object that will be the target of loading later.
303
303
The import system passes in a target module only during reload.
304
304
@@ -616,7 +616,7 @@ the module.
616
616
module.__path__
617
617
---------------
618
618
619
- By definition, if a module has an ``__path__ `` attribute, it is a package,
619
+ By definition, if a module has a ``__path__ `` attribute, it is a package,
620
620
regardless of its value.
621
621
622
622
A package's ``__path__ `` attribute is used during imports of its subpackages.
0 commit comments