summaryrefslogtreecommitdiffstats
path: root/Doc/tutorial
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-07-29 17:07:21 (GMT)
committerGeorg Brandl <georg@python.org>2009-07-29 17:07:21 (GMT)
commitffefd5a8bb9317284257c2a035ac396ec69b8232 (patch)
tree04126280785d730d363ac9eb27bea59dda184f85 /Doc/tutorial
parent07e20f8729114cb4c36a7592a0047e2b471404b9 (diff)
downloadcpython-ffefd5a8bb9317284257c2a035ac396ec69b8232.zip
cpython-ffefd5a8bb9317284257c2a035ac396ec69b8232.tar.gz
cpython-ffefd5a8bb9317284257c2a035ac396ec69b8232.tar.bz2
Fix some markup and small factual glitches found by M. Markert.
Diffstat (limited to 'Doc/tutorial')
-rw-r--r--Doc/tutorial/modules.rst17
-rw-r--r--Doc/tutorial/stdlib2.rst15
2 files changed, 18 insertions, 14 deletions
diff --git a/Doc/tutorial/modules.rst b/Doc/tutorial/modules.rst
index c1ff982..42a52e5 100644
--- a/Doc/tutorial/modules.rst
+++ b/Doc/tutorial/modules.rst
@@ -446,14 +446,14 @@ one would hope that this somehow goes out to the filesystem, finds which
submodules are present in the package, and imports them all. Unfortunately,
this operation does not work very well on Windows platforms, where the
filesystem does not always have accurate information about the case of a
-filename! On these platforms, there is no guaranteed way to know whether a file
+filename. On these platforms, there is no guaranteed way to know whether a file
:file:`ECHO.PY` should be imported as a module :mod:`echo`, :mod:`Echo` or
:mod:`ECHO`. (For example, Windows 95 has the annoying practice of showing all
file names with a capitalized first letter.) The DOS 8+3 filename restriction
adds another interesting problem for long module names.
The only solution is for the package author to provide an explicit index of the
-package. The import statement uses the following convention: if a package's
+package. The :keyword:`import` statement uses the following convention: if a package's
:file:`__init__.py` code defines a list named ``__all__``, it is taken to be the
list of module names that should be imported when ``from package import *`` is
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`)
and then imports whatever names are defined in the package. This includes any
names defined (and submodules explicitly loaded) by :file:`__init__.py`. It
also includes any submodules of the package that were explicitly loaded by
-previous import statements. Consider this code::
+previous :keyword:`import` statements. Consider this code::
import sound.effects.echo
import sound.effects.surround
from sound.effects import *
-In this example, the echo and surround modules are imported in the current
-namespace because they are defined in the :mod:`sound.effects` package when the
-``from...import`` statement is executed. (This also works when ``__all__`` is
-defined.)
+In this example, the :mod:`echo` and :mod:`surround` modules are imported in the
+current namespace because they are defined in the :mod:`sound.effects` package
+when the ``from...import`` statement is executed. (This also works when
+``__all__`` is defined.)
Note that in general the practice of importing ``*`` from a module or package is
frowned upon, since it often causes poorly readable code. However, it is okay to
@@ -546,5 +546,6 @@ modules found in a package.
.. rubric:: Footnotes
.. [#] In fact function definitions are also 'statements' that are 'executed'; the
- execution enters the function name in the module's global symbol table.
+ execution of a module-level function enters the function name in the module's
+ global symbol table.
diff --git a/Doc/tutorial/stdlib2.rst b/Doc/tutorial/stdlib2.rst
index 0d1d4c7..6f0a6ed 100644
--- a/Doc/tutorial/stdlib2.rst
+++ b/Doc/tutorial/stdlib2.rst
@@ -347,12 +347,15 @@ Decimal Floating Point Arithmetic
The :mod:`decimal` module offers a :class:`Decimal` datatype for decimal
floating point arithmetic. Compared to the built-in :class:`float`
-implementation of binary floating point, the new class is especially helpful for
-financial applications and other uses which require exact decimal
-representation, control over precision, control over rounding to meet legal or
-regulatory requirements, tracking of significant decimal places, or for
-applications where the user expects the results to match calculations done by
-hand.
+implementation of binary floating point, the class is especially helpful for
+
+* financial applications and other uses which require exact decimal
+ representation,
+* control over precision,
+* control over rounding to meet legal or regulatory requirements,
+* tracking of significant decimal places, or
+* applications where the user expects the results to match calculations done by
+ hand.
For example, calculating a 5% tax on a 70 cent phone charge gives different
results in decimal floating point and binary floating point. The difference