@@ -446,14 +446,14 @@ one would hope that this somehow goes out to the filesystem, finds which
446446submodules are present in the package, and imports them all. Unfortunately,
447447this operation does not work very well on Windows platforms, where the
448448filesystem does not always have accurate information about the case of a
449- filename! On these platforms, there is no guaranteed way to know whether a file
449+ filename. On these platforms, there is no guaranteed way to know whether a file
450450:file: `ECHO.PY ` should be imported as a module :mod: `echo `, :mod: `Echo ` or
451451:mod: `ECHO `. (For example, Windows 95 has the annoying practice of showing all
452452file names with a capitalized first letter.) The DOS 8+3 filename restriction
453453adds another interesting problem for long module names.
454454
455455The only solution is for the package author to provide an explicit index of the
456- package. The import statement uses the following convention: if a package's
456+ package. The :keyword: ` import ` statement uses the following convention: if a package's
457457:file: `__init__.py ` code defines a list named ``__all__ ``, it is taken to be the
458458list of module names that should be imported when ``from package import * `` is
459459encountered. It is up to the package author to keep this list up-to-date when a
@@ -474,16 +474,16 @@ been imported (possibly running any initialization code in :file:`__init__.py`)
474474and then imports whatever names are defined in the package. This includes any
475475names defined (and submodules explicitly loaded) by :file: `__init__.py `. It
476476also includes any submodules of the package that were explicitly loaded by
477- previous import statements. Consider this code::
477+ previous :keyword: ` import ` statements. Consider this code::
478478
479479 import sound.effects.echo
480480 import sound.effects.surround
481481 from sound.effects import *
482482
483- In this example, the echo and surround modules are imported in the current
484- namespace because they are defined in the :mod: `sound.effects ` package when the
485- ``from...import `` statement is executed. (This also works when `` __all__ `` is
486- defined.)
483+ In this example, the :mod: ` echo ` and :mod: ` surround ` modules are imported in the
484+ current namespace because they are defined in the :mod: `sound.effects ` package
485+ when the ``from...import `` statement is executed. (This also works when
486+ `` __all__ `` is defined.)
487487
488488Note that in general the practice of importing ``* `` from a module or package is
489489frowned upon, since it often causes poorly readable code. However, it is okay to
@@ -546,5 +546,6 @@ modules found in a package.
546546.. rubric :: Footnotes
547547
548548.. [# ] In fact function definitions are also 'statements' that are 'executed'; the
549- execution enters the function name in the module's global symbol table.
549+ execution of a module-level function enters the function name in the module's
550+ global symbol table.
550551
0 commit comments