diff options
author | Georg Brandl <georg@python.org> | 2008-05-25 07:20:14 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2008-05-25 07:20:14 (GMT) |
commit | a6168f9e0a0ff77910e783df36f5dd4b5dfa7372 (patch) | |
tree | 5424d6e36503bda00ee3a63638737a9973b4a4fb /Doc/tutorial | |
parent | 8107290fa186bd5efa2a9c158000fd578d228a6c (diff) | |
download | cpython-a6168f9e0a0ff77910e783df36f5dd4b5dfa7372.zip cpython-a6168f9e0a0ff77910e783df36f5dd4b5dfa7372.tar.gz cpython-a6168f9e0a0ff77910e783df36f5dd4b5dfa7372.tar.bz2 |
Queue renaming reversal part 3: move module into place and
change imports and other references. Closes #2925.
Diffstat (limited to 'Doc/tutorial')
-rw-r--r-- | Doc/tutorial/stdlib2.rst | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Doc/tutorial/stdlib2.rst b/Doc/tutorial/stdlib2.rst index 9da5213..459d765 100644 --- a/Doc/tutorial/stdlib2.rst +++ b/Doc/tutorial/stdlib2.rst @@ -16,7 +16,7 @@ Output Formatting The :mod:`repr` module provides a version of :func:`repr` customized for abbreviated displays of large or deeply nested containers:: - >>> import repr + >>> import repr >>> repr.repr(set('supercalifragilisticexpialidocious')) "set(['a', 'c', 'd', 'e', 'f', 'g', ...])" @@ -174,7 +174,7 @@ tasks in background while the main program continues to run:: class AsyncZip(threading.Thread): def __init__(self, infile, outfile): - threading.Thread.__init__(self) + threading.Thread.__init__(self) self.infile = infile self.outfile = outfile def run(self): @@ -198,9 +198,9 @@ variables, and semaphores. While those tools are powerful, minor design errors can result in problems that are difficult to reproduce. So, the preferred approach to task coordination is to concentrate all access to a resource in a single thread and then use the -:mod:`queue` module to feed that thread with requests from other threads. -Applications using :class:`Queue` objects for inter-thread communication and -coordination are easier to design, more readable, and more reliable. +:mod:`Queue` module to feed that thread with requests from other threads. +Applications using :class:`Queue.Queue` objects for inter-thread communication +and coordination are easier to design, more readable, and more reliable. .. _tut-logging: @@ -358,11 +358,11 @@ 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 becomes significant if the results are rounded to the nearest cent:: - >>> from decimal import * + >>> from decimal import * >>> Decimal('0.70') * Decimal('1.05') Decimal("0.7350") >>> .70 * 1.05 - 0.73499999999999999 + 0.73499999999999999 The :class:`Decimal` result keeps a trailing zero, automatically inferring four place significance from multiplicands with two place significance. Decimal @@ -380,7 +380,7 @@ calculations and equality tests that are unsuitable for binary floating point:: >>> sum([Decimal('0.1')]*10) == Decimal('1.0') True >>> sum([0.1]*10) == 1.0 - False + False The :mod:`decimal` module provides arithmetic with as much precision as needed:: |