summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-10-06 08:54:16 (GMT)
committerGeorg Brandl <georg@python.org>2010-10-06 08:54:16 (GMT)
commit57a5e3f0e288b70267297511f5af2c92721d7e2d (patch)
tree7348a8135f76e90360e39b8e9c88b87a591be46d /Doc
parent23b4f927d5e1c55ee0ff26570dfcaf3f307254fe (diff)
downloadcpython-57a5e3f0e288b70267297511f5af2c92721d7e2d.zip
cpython-57a5e3f0e288b70267297511f5af2c92721d7e2d.tar.gz
cpython-57a5e3f0e288b70267297511f5af2c92721d7e2d.tar.bz2
Merged revisions 84249,84264,84326-84327,84407,84476,84480-84482,84484,84530-84531,84553,84619,84684,84915-84916 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ........ r84249 | georg.brandl | 2010-08-22 01:20:01 +0200 (So, 22 Aug 2010) | 1 line Remove usage of rexec in tkinter demo. ........ r84264 | georg.brandl | 2010-08-22 22:23:38 +0200 (So, 22 Aug 2010) | 1 line #9649: fix default value description. ........ r84326 | georg.brandl | 2010-08-26 16:30:15 +0200 (Do, 26 Aug 2010) | 1 line #9689: add links from overview to in-depth class API descriptions. ........ r84327 | georg.brandl | 2010-08-26 16:30:56 +0200 (Do, 26 Aug 2010) | 1 line #9681: typo. ........ r84407 | georg.brandl | 2010-09-01 23:02:50 +0200 (Mi, 01 Sep 2010) | 1 line #9677: fix link. ........ r84476 | georg.brandl | 2010-09-04 00:14:52 +0200 (Sa, 04 Sep 2010) | 1 line Use tabs consistently. ........ r84480 | georg.brandl | 2010-09-04 00:33:27 +0200 (Sa, 04 Sep 2010) | 1 line More inclusive title. ........ r84481 | georg.brandl | 2010-09-04 00:36:22 +0200 (Sa, 04 Sep 2010) | 1 line #9767: doctest run over json docs. ........ r84482 | georg.brandl | 2010-09-04 00:40:02 +0200 (Sa, 04 Sep 2010) | 1 line #9760: clarify what context expression is. ........ r84484 | georg.brandl | 2010-09-04 00:49:27 +0200 (Sa, 04 Sep 2010) | 1 line Fix missing word. ........ r84530 | georg.brandl | 2010-09-05 19:07:12 +0200 (So, 05 Sep 2010) | 1 line #9747: fix copy-paste error in getresgid() doc. ........ r84531 | georg.brandl | 2010-09-05 19:09:18 +0200 (So, 05 Sep 2010) | 1 line #9776: fix some spacing. ........ r84553 | georg.brandl | 2010-09-06 08:49:07 +0200 (Mo, 06 Sep 2010) | 1 line #9780: both { and } are not valid fill characters. ........ r84619 | georg.brandl | 2010-09-08 12:43:45 +0200 (Mi, 08 Sep 2010) | 1 line Add Lukasz. ........ r84684 | georg.brandl | 2010-09-10 22:43:53 +0200 (Fr, 10 Sep 2010) | 1 line release() is probably not the most important method ........ r84915 | georg.brandl | 2010-09-20 08:27:02 +0200 (Mo, 20 Sep 2010) | 1 line Fix typo. ........ r84916 | georg.brandl | 2010-09-20 08:29:01 +0200 (Mo, 20 Sep 2010) | 1 line Mention % as string formatting. ........
Diffstat (limited to 'Doc')
-rw-r--r--Doc/conf.py2
-rw-r--r--Doc/library/json.rst12
-rw-r--r--Doc/library/multiprocessing.rst4
-rw-r--r--Doc/library/string.rst10
-rw-r--r--Doc/library/subprocess.rst2
-rw-r--r--Doc/library/threading.rst16
-rw-r--r--Doc/reference/compound_stmts.rst3
-rw-r--r--Doc/reference/expressions.rst3
-rw-r--r--Doc/tools/sphinxext/indexcontent.html2
-rw-r--r--Doc/tutorial/datastructures.rst2
-rw-r--r--Doc/using/index.rst6
11 files changed, 41 insertions, 21 deletions
diff --git a/Doc/conf.py b/Doc/conf.py
index 9603b4b..6a04a45 100644
--- a/Doc/conf.py
+++ b/Doc/conf.py
@@ -128,7 +128,7 @@ latex_documents = [
('tutorial/index', 'tutorial.tex',
'Python Tutorial', _stdauthor, 'manual'),
('using/index', 'using.tex',
- 'Python Setup', _stdauthor, 'manual'),
+ 'Python Setup and Usage', _stdauthor, 'manual'),
('whatsnew/' + version, 'whatsnew.tex',
'What\'s New in Python', 'A. M. Kuchling', 'howto'),
]
diff --git a/Doc/library/json.rst b/Doc/library/json.rst
index e1f5cf2..3b203a2 100644
--- a/Doc/library/json.rst
+++ b/Doc/library/json.rst
@@ -82,12 +82,12 @@ Extending :class:`JSONEncoder`::
... return [obj.real, obj.imag]
... return json.JSONEncoder.default(self, obj)
...
- >>> dumps(2 + 1j, cls=ComplexEncoder)
+ >>> json.dumps(2 + 1j, cls=ComplexEncoder)
'[2.0, 1.0]'
>>> ComplexEncoder().encode(2 + 1j)
'[2.0, 1.0]'
>>> list(ComplexEncoder().iterencode(2 + 1j))
- ['[', '2.0', ', ', '1.0', ']']
+ ['[2.0', ', 1.0', ']']
.. highlight:: none
@@ -339,7 +339,7 @@ Encoders and decoders
encoders and decoders. Otherwise, it will be a :exc:`ValueError` to encode
such floats.
- If *sort_keys* is ``True`` (the default), then the output of dictionaries
+ If *sort_keys* is ``True`` (default ``False``), then the output of dictionaries
will be sorted by key; this is useful for regression tests to ensure that
JSON serializations can be compared on a day-to-day basis.
@@ -373,7 +373,7 @@ Encoders and decoders
pass
else:
return list(iterable)
- return JSONEncoder.default(self, o)
+ return json.JSONEncoder.default(self, o)
.. method:: encode(o)
@@ -381,7 +381,7 @@ Encoders and decoders
Return a JSON string representation of a Python data structure, *o*. For
example::
- >>> JSONEncoder().encode({"foo": ["bar", "baz"]})
+ >>> json.JSONEncoder().encode({"foo": ["bar", "baz"]})
'{"foo": ["bar", "baz"]}'
@@ -390,5 +390,5 @@ Encoders and decoders
Encode the given object, *o*, and yield each string representation as
available. For example::
- for chunk in JSONEncoder().iterencode(bigobject):
+ for chunk in json.JSONEncoder().iterencode(bigobject):
mysocket.write(chunk)
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index bd79a3e..27b4c90 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -2210,8 +2210,8 @@ Synchronization types like locks, conditions and queues:
.. literalinclude:: ../includes/mp_synchronize.py
-An showing how to use queues to feed tasks to a collection of worker process and
-collect the results:
+An example showing how to use queues to feed tasks to a collection of worker
+process and collect the results:
.. literalinclude:: ../includes/mp_workers.py
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index dd04e32..6748484 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -299,11 +299,11 @@ The general form of a *standard format specifier* is:
precision: `integer`
type: "b" | "c" | "d" | "e" | "E" | "f" | "F" | "g" | "G" | "n" | "o" | "s" | "x" | "X" | "%"
-The *fill* character can be any character other than '}' (which signifies the
-end of the field). The presence of a fill character is signaled by the *next*
-character, which must be one of the alignment options. If the second character
-of *format_spec* is not a valid alignment option, then it is assumed that both
-the fill character and the alignment option are absent.
+The *fill* character can be any character other than '{' or '}'. The presence
+of a fill character is signaled by the character following it, which must be
+one of the alignment options. If the second character of *format_spec* is not
+a valid alignment option, then it is assumed that both the fill character and
+the alignment option are absent.
The meaning of the various alignment options is as follows:
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst
index 3aaa6c6..0c441f8 100644
--- a/Doc/library/subprocess.rst
+++ b/Doc/library/subprocess.rst
@@ -275,7 +275,7 @@ Exceptions
Exceptions raised in the child process, before the new program has started to
execute, will be re-raised in the parent. Additionally, the exception object
will have one extra attribute called :attr:`child_traceback`, which is a string
-containing traceback information from the childs point of view.
+containing traceback information from the child's point of view.
The most common exception raised is :exc:`OSError`. This occurs, for example,
when trying to execute a non-existent file. Applications should prepare for
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index 68d0304..2e36402 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -33,6 +33,8 @@ This module defines the following functions and objects:
variable allows one or more threads to wait until they are notified by another
thread.
+ See :ref:`condition-objects`.
+
.. function:: current_thread()
@@ -58,6 +60,8 @@ This module defines the following functions and objects:
with the :meth:`clear` method. The :meth:`wait` method blocks until the flag
is true.
+ See :ref:`event-objects`.
+
.. class:: local
@@ -80,6 +84,8 @@ This module defines the following functions and objects:
acquired it, subsequent attempts to acquire it block, until it is released; any
thread may release it.
+ See :ref:`lock-objects`.
+
.. function:: RLock()
@@ -88,6 +94,8 @@ This module defines the following functions and objects:
reentrant lock, the same thread may acquire it again without blocking; the
thread must release it once for each time it has acquired it.
+ See :ref:`rlock-objects`.
+
.. function:: Semaphore(value=1)
:noindex:
@@ -98,6 +106,8 @@ This module defines the following functions and objects:
if necessary until it can return without making the counter negative. If not
given, *value* defaults to 1.
+ See :ref:`semaphore-objects`.
+
.. function:: BoundedSemaphore(value=1)
@@ -109,15 +119,21 @@ This module defines the following functions and objects:
.. class:: Thread
+ :noindex:
A class that represents a thread of control. This class can be safely
subclassed in a limited fashion.
+ See :ref:`thread-objects`.
+
.. class:: Timer
+ :noindex:
A thread that executes a function after a specified interval has passed.
+ See :ref:`timer-objects`.
+
.. function:: settrace(func)
diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst
index e2db33c..5582cf6 100644
--- a/Doc/reference/compound_stmts.rst
+++ b/Doc/reference/compound_stmts.rst
@@ -350,7 +350,8 @@ usage patterns to be encapsulated for convenient reuse.
The execution of the :keyword:`with` statement with one "item" proceeds as follows:
-#. The context expression is evaluated to obtain a context manager.
+#. The context expression (the expression given in the :token:`with_item`) is
+ evaluated to obtain a context manager.
#. The context manager's :meth:`__enter__` method is invoked.
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index c71e89e..f6a90cc 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -1297,6 +1297,7 @@ groups from right to left).
| ``+``, ``-`` | Addition and subtraction |
+-----------------------------------------------+-------------------------------------+
| ``*``, ``/``, ``//``, ``%`` | Multiplication, division, remainder |
+| | [#]_ |
+-----------------------------------------------+-------------------------------------+
| ``+x``, ``-x``, ``~x`` | Positive, negative, bitwise NOT |
+-----------------------------------------------+-------------------------------------+
@@ -1339,5 +1340,7 @@ groups from right to left).
the :keyword:`is` operator, like those involving comparisons between instance
methods, or constants. Check their documentation for more info.
+.. [#] The ``%`` is also used for string formatting; the same precedence applies.
+
.. [#] The power operator ``**`` binds less tightly than an arithmetic or
bitwise unary operator on its right, that is, ``2**-1`` is ``0.5``.
diff --git a/Doc/tools/sphinxext/indexcontent.html b/Doc/tools/sphinxext/indexcontent.html
index e364dce..10a070c 100644
--- a/Doc/tools/sphinxext/indexcontent.html
+++ b/Doc/tools/sphinxext/indexcontent.html
@@ -11,7 +11,7 @@
<span class="linkdescr">keep this under your pillow</span></p>
<p class="biglink"><a class="biglink" href="{{ pathto("reference/index") }}">Language Reference</a><br/>
<span class="linkdescr">describes syntax and language elements</span></p>
- <p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">Python Setup</a><br/>
+ <p class="biglink"><a class="biglink" href="{{ pathto("using/index") }}">Python Setup and Usage</a><br/>
<span class="linkdescr">how to use Python on different platforms</span></p>
<p class="biglink"><a class="biglink" href="{{ pathto("howto/index") }}">Python HOWTOs</a><br/>
<span class="linkdescr">in-depth documents on specific topics</span></p>
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
index 8394c10..4f3d498 100644
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -371,7 +371,7 @@ with no duplicate elements. Basic uses include membership testing and
eliminating duplicate entries. Set objects also support mathematical operations
like union, intersection, difference, and symmetric difference.
-Curly braces or the :func:`set` function can be use to create sets. Note: To
+Curly braces or the :func:`set` function can be used to create sets. Note: To
create an empty set you have to use ``set()``, not ``{}``; the latter creates an
empty dictionary, a data structure that we discuss in the next section.
diff --git a/Doc/using/index.rst b/Doc/using/index.rst
index 6bba578..1201153 100644
--- a/Doc/using/index.rst
+++ b/Doc/using/index.rst
@@ -1,8 +1,8 @@
.. _using-index:
-################
- Python Setup
-################
+##########################
+ Python Setup and Usage
+##########################
This part of the documentation is devoted to general information on the setup