Skip to content

Commit ffefd5a

Browse files
committed
Fix some markup and small factual glitches found by M. Markert.
1 parent 07e20f8 commit ffefd5a

2 files changed

Lines changed: 18 additions & 14 deletions

File tree

Doc/tutorial/modules.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,14 @@ one would hope that this somehow goes out to the filesystem, finds which
446446
submodules are present in the package, and imports them all. Unfortunately,
447447
this operation does not work very well on Windows platforms, where the
448448
filesystem 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
452452
file names with a capitalized first letter.) The DOS 8+3 filename restriction
453453
adds another interesting problem for long module names.
454454

455455
The 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
458458
list of module names that should be imported when ``from package import *`` is
459459
encountered. 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`)
474474
and then imports whatever names are defined in the package. This includes any
475475
names defined (and submodules explicitly loaded) by :file:`__init__.py`. It
476476
also 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

488488
Note that in general the practice of importing ``*`` from a module or package is
489489
frowned 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

Doc/tutorial/stdlib2.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,12 +347,15 @@ Decimal Floating Point Arithmetic
347347

348348
The :mod:`decimal` module offers a :class:`Decimal` datatype for decimal
349349
floating point arithmetic. Compared to the built-in :class:`float`
350-
implementation of binary floating point, the new class is especially helpful for
351-
financial applications and other uses which require exact decimal
352-
representation, control over precision, control over rounding to meet legal or
353-
regulatory requirements, tracking of significant decimal places, or for
354-
applications where the user expects the results to match calculations done by
355-
hand.
350+
implementation of binary floating point, the class is especially helpful for
351+
352+
* financial applications and other uses which require exact decimal
353+
representation,
354+
* control over precision,
355+
* control over rounding to meet legal or regulatory requirements,
356+
* tracking of significant decimal places, or
357+
* applications where the user expects the results to match calculations done by
358+
hand.
356359

357360
For example, calculating a 5% tax on a 70 cent phone charge gives different
358361
results in decimal floating point and binary floating point. The difference

0 commit comments

Comments
 (0)