summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-08-13 08:26:44 (GMT)
committerGeorg Brandl <georg@python.org>2009-08-13 08:26:44 (GMT)
commitc5605dffdb226e85f415bd6edb441dad714fbc0c (patch)
treed6b21f2376be108b3a7bb8996e5456580451ddd7 /Doc/library
parent084605518d27574e7ad43d0f68a4e8cc37585d37 (diff)
downloadcpython-c5605dffdb226e85f415bd6edb441dad714fbc0c.zip
cpython-c5605dffdb226e85f415bd6edb441dad714fbc0c.tar.gz
cpython-c5605dffdb226e85f415bd6edb441dad714fbc0c.tar.bz2
Merged revisions 73941-73943,74076,74094,74186,74211-74214,74247,74254,74262,74311,74334,74368 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ................ r73941 | georg.brandl | 2009-07-11 12:39:00 +0200 (Sa, 11 Jul 2009) | 9 lines Merged revisions 73940 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r73940 | georg.brandl | 2009-07-11 12:37:38 +0200 (Sa, 11 Jul 2009) | 1 line #6430: add note about size of "u" type. ........ ................ r73942 | georg.brandl | 2009-07-11 12:39:23 +0200 (Sa, 11 Jul 2009) | 1 line #6430: remove mention of "w" array typecode. ................ r73943 | georg.brandl | 2009-07-11 12:43:08 +0200 (Sa, 11 Jul 2009) | 1 line #6421: The self argument of module-level PyCFunctions is now a reference to the module object. ................ r74076 | georg.brandl | 2009-07-18 11:07:48 +0200 (Sa, 18 Jul 2009) | 1 line #6502: add missing comma in docstring. ................ r74094 | georg.brandl | 2009-07-19 09:25:56 +0200 (So, 19 Jul 2009) | 10 lines Recorded merge of revisions 74089 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74089 | senthil.kumaran | 2009-07-19 04:43:43 +0200 (So, 19 Jul 2009) | 3 lines Fix for issue5102, timeout value propages between redirects, proxy, digest and auth handlers. Fixed tests to reflect the same. ........ ................ r74186 | georg.brandl | 2009-07-23 11:19:09 +0200 (Do, 23 Jul 2009) | 9 lines Recorded merge of revisions 74185 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74185 | georg.brandl | 2009-07-23 11:17:09 +0200 (Do, 23 Jul 2009) | 1 line Fix the "pylocals" gdb command. ........ ................ r74211 | georg.brandl | 2009-07-26 16:48:09 +0200 (So, 26 Jul 2009) | 9 lines Recorded merge of revisions 74210 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74210 | georg.brandl | 2009-07-26 16:44:23 +0200 (So, 26 Jul 2009) | 1 line Move member descriptions inside the classes. ........ ................ r74212 | georg.brandl | 2009-07-26 16:54:51 +0200 (So, 26 Jul 2009) | 9 lines Merged revisions 74209 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74209 | georg.brandl | 2009-07-26 16:37:28 +0200 (So, 26 Jul 2009) | 1 line builtin -> built-in. ........ ................ r74213 | georg.brandl | 2009-07-26 17:02:41 +0200 (So, 26 Jul 2009) | 9 lines Merged revisions 74207 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74207 | georg.brandl | 2009-07-26 16:19:57 +0200 (So, 26 Jul 2009) | 1 line #6577: fix (hopefully) all links to builtin instead of module/class-specific objects. ........ ................ r74214 | georg.brandl | 2009-07-26 17:03:49 +0200 (So, 26 Jul 2009) | 9 lines Merged revisions 74205 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74205 | georg.brandl | 2009-07-26 15:36:39 +0200 (So, 26 Jul 2009) | 1 line #6576: fix cross-refs in re docs. ........ ................ r74247 | georg.brandl | 2009-07-29 09:27:08 +0200 (Mi, 29 Jul 2009) | 9 lines Merged revisions 74239 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74239 | georg.brandl | 2009-07-28 18:55:32 +0000 (Di, 28 Jul 2009) | 1 line Clarify quote_plus() usage. ........ ................ r74254 | georg.brandl | 2009-07-29 18:14:16 +0200 (Mi, 29 Jul 2009) | 1 line #6586: fix return/argument type doc for os.read() and os.write(). ................ r74262 | alexandre.vassalotti | 2009-07-29 21:54:39 +0200 (Mi, 29 Jul 2009) | 57 lines Merged revisions 74074,74077,74111,74188,74192-74193,74200,74252-74253,74258-74261 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74074 | georg.brandl | 2009-07-18 05:03:10 -0400 (Sat, 18 Jul 2009) | 1 line #6513: fix example code: warning categories are classes, not instances. ........ r74077 | georg.brandl | 2009-07-18 05:43:40 -0400 (Sat, 18 Jul 2009) | 1 line #6489: fix an ambiguity in getiterator() documentation. ........ r74111 | benjamin.peterson | 2009-07-20 09:30:10 -0400 (Mon, 20 Jul 2009) | 1 line remove docs for deprecated -p option ........ r74188 | benjamin.peterson | 2009-07-23 10:25:31 -0400 (Thu, 23 Jul 2009) | 1 line use bools ........ r74192 | georg.brandl | 2009-07-24 12:28:38 -0400 (Fri, 24 Jul 2009) | 1 line Fix arg types of et#. ........ r74193 | georg.brandl | 2009-07-24 12:46:38 -0400 (Fri, 24 Jul 2009) | 1 line Dont put "void" in signature for nullary functions. ........ r74200 | georg.brandl | 2009-07-25 09:02:15 -0400 (Sat, 25 Jul 2009) | 1 line #6571: add index entries for more operators. ........ r74252 | georg.brandl | 2009-07-29 12:06:31 -0400 (Wed, 29 Jul 2009) | 1 line #6593: fix link targets. ........ r74253 | georg.brandl | 2009-07-29 12:09:17 -0400 (Wed, 29 Jul 2009) | 1 line #6591: add reference to ioctl in fcntl module for platforms other than Windows. ........ r74258 | georg.brandl | 2009-07-29 12:57:05 -0400 (Wed, 29 Jul 2009) | 1 line Add a link to readline, and mention IPython and bpython. ........ r74259 | georg.brandl | 2009-07-29 13:07:21 -0400 (Wed, 29 Jul 2009) | 1 line Fix some markup and small factual glitches found by M. Markert. ........ r74260 | georg.brandl | 2009-07-29 13:15:20 -0400 (Wed, 29 Jul 2009) | 1 line Fix a few markup glitches. ........ r74261 | georg.brandl | 2009-07-29 13:50:25 -0400 (Wed, 29 Jul 2009) | 1 line Rewrite the section about classes a bit; mostly tidbits, and a larger update to the section about "private" variables to reflect the Pythonic consensus better. ........ ................ r74311 | georg.brandl | 2009-08-04 22:29:27 +0200 (Di, 04 Aug 2009) | 1 line Slightly improve buffer-related error message. ................ r74334 | georg.brandl | 2009-08-06 19:51:03 +0200 (Do, 06 Aug 2009) | 1 line #6648: mention surrogateescape handler where all standard handlers are listed. ................ r74368 | georg.brandl | 2009-08-13 09:56:35 +0200 (Do, 13 Aug 2009) | 21 lines Merged revisions 74328,74332-74333,74365 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74328 | georg.brandl | 2009-08-06 17:06:25 +0200 (Do, 06 Aug 2009) | 1 line Fix base keyword arg name for int() and long(). ........ r74332 | georg.brandl | 2009-08-06 19:23:21 +0200 (Do, 06 Aug 2009) | 1 line Fix punctuation and one copy-paste error. ........ r74333 | georg.brandl | 2009-08-06 19:43:55 +0200 (Do, 06 Aug 2009) | 1 line #6658: fix two typos. ........ r74365 | georg.brandl | 2009-08-13 09:48:05 +0200 (Do, 13 Aug 2009) | 1 line #6679: Remove mention that sub supports no flags. ........ ................
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/2to3.rst14
-rw-r--r--Doc/library/__future__.rst2
-rw-r--r--Doc/library/aifc.rst4
-rw-r--r--Doc/library/array.rst7
-rw-r--r--Doc/library/ast.rst2
-rw-r--r--Doc/library/audioop.rst2
-rw-r--r--Doc/library/cgi.rst8
-rw-r--r--Doc/library/codecs.rst7
-rw-r--r--Doc/library/collections.rst2
-rw-r--r--Doc/library/configparser.rst2
-rw-r--r--Doc/library/csv.rst2
-rw-r--r--Doc/library/curses.rst8
-rw-r--r--Doc/library/dbm.rst2
-rw-r--r--Doc/library/decimal.rst4
-rw-r--r--Doc/library/functions.rst8
-rw-r--r--Doc/library/gettext.rst8
-rw-r--r--Doc/library/heapq.rst2
-rw-r--r--Doc/library/io.rst12
-rw-r--r--Doc/library/locale.rst6
-rw-r--r--Doc/library/logging.rst2
-rw-r--r--Doc/library/multiprocessing.rst12
-rw-r--r--Doc/library/numbers.rst2
-rw-r--r--Doc/library/optparse.rst38
-rw-r--r--Doc/library/os.rst24
-rw-r--r--Doc/library/ossaudiodev.rst2
-rw-r--r--Doc/library/pprint.rst2
-rw-r--r--Doc/library/pyclbr.rst4
-rw-r--r--Doc/library/re.rst53
-rw-r--r--Doc/library/reprlib.rst15
-rw-r--r--Doc/library/select.rst23
-rw-r--r--Doc/library/shelve.rst4
-rw-r--r--Doc/library/socket.rst2
-rw-r--r--Doc/library/sqlite3.rst2
-rw-r--r--Doc/library/stdtypes.rst42
-rw-r--r--Doc/library/string.rst2
-rw-r--r--Doc/library/sunau.rst10
-rw-r--r--Doc/library/sys.rst2
-rw-r--r--Doc/library/tempfile.rst4
-rw-r--r--Doc/library/threading.rst330
-rw-r--r--Doc/library/tkinter.rst4
-rw-r--r--Doc/library/undoc.rst1
-rw-r--r--Doc/library/urllib.parse.rst6
-rw-r--r--Doc/library/warnings.rst2
-rw-r--r--Doc/library/wave.rst6
-rw-r--r--Doc/library/weakref.rst2
-rw-r--r--Doc/library/webbrowser.rst18
-rw-r--r--Doc/library/winreg.rst2
-rw-r--r--Doc/library/xml.etree.elementtree.rst6
-rw-r--r--Doc/library/xmlrpc.client.rst2
-rw-r--r--Doc/library/zipimport.rst2
50 files changed, 360 insertions, 368 deletions
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst
index 9b2b4e4..f37bb05 100644
--- a/Doc/library/2to3.rst
+++ b/Doc/library/2to3.rst
@@ -86,13 +86,6 @@ document could also be refactored with this option.
The :option:`-v` option enables output of more information on the translation
process.
-When the :option:`-p` is passed, the :2to3fixer:`print` fixer ``print`` as a
-function instead of a statement. This is useful when ``from __future__ import
-print_function`` is being used. If this option is not given, the print fixer
-will surround print calls in an extra set of parentheses because it cannot
-differentiate between the print statement with parentheses (such as ``print
-("a" + "b" + "c")``) and a true function call.
-
.. _2to3-fixers:
@@ -216,7 +209,7 @@ and off individually. They are described here in more detail.
.. 2to3fixer:: itertools
Changes usage of :func:`itertools.ifilter`, :func:`itertools.izip`, and
- :func:`itertools.imap` to their builtin equivalents.
+ :func:`itertools.imap` to their built-in equivalents.
:func:`itertools.ifilterfalse` is changed to :func:`itertools.filterfalse`.
.. 2to3fixer:: long
@@ -246,8 +239,9 @@ and off individually. They are described here in more detail.
.. 2to3fixer:: next
- Converts the use of iterator's :meth:`next` methods to the :func:`next`
- function. It also renames :meth:`next` methods to :meth:`~object.__next__`.
+ Converts the use of iterator's :meth:`~iterator.next` methods to the
+ :func:`next` function. It also renames :meth:`next` methods to
+ :meth:`~object.__next__`.
.. 2to3fixer:: nonzero
diff --git a/Doc/library/__future__.rst b/Doc/library/__future__.rst
index b09246e..29f3109 100644
--- a/Doc/library/__future__.rst
+++ b/Doc/library/__future__.rst
@@ -52,7 +52,7 @@ Instances of class :class:`_Feature` have two corresponding methods,
:meth:`getOptionalRelease` and :meth:`getMandatoryRelease`.
*CompilerFlag* is the (bitfield) flag that should be passed in the fourth
-argument to the builtin function :func:`compile` to enable the feature in
+argument to the built-in function :func:`compile` to enable the feature in
dynamically compiled code. This flag is stored in the :attr:`compiler_flag`
attribute on :class:`_Feature` instances.
diff --git a/Doc/library/aifc.rst b/Doc/library/aifc.rst
index 59837ce..bdd3517 100644
--- a/Doc/library/aifc.rst
+++ b/Doc/library/aifc.rst
@@ -48,7 +48,7 @@ Module :mod:`aifc` defines the following function:
time how many samples you are going to write in total and use
:meth:`writeframesraw` and :meth:`setnframes`.
-Objects returned by :func:`open` when a file is opened for reading have the
+Objects returned by :func:`.open` when a file is opened for reading have the
following methods:
@@ -133,7 +133,7 @@ following methods:
Close the AIFF file. After calling this method, the object can no longer be
used.
-Objects returned by :func:`open` when a file is opened for writing have all the
+Objects returned by :func:`.open` when a file is opened for writing have all the
above methods, except for :meth:`readframes` and :meth:`setpos`. In addition
the following methods exist. The :meth:`get\*` methods can only be called after
the corresponding :meth:`set\*` methods have been called. Before the first
diff --git a/Doc/library/array.rst b/Doc/library/array.rst
index 200277f..78c433d 100644
--- a/Doc/library/array.rst
+++ b/Doc/library/array.rst
@@ -21,7 +21,7 @@ defined:
+-----------+----------------+-------------------+-----------------------+
| ``'B'`` | unsigned char | int | 1 |
+-----------+----------------+-------------------+-----------------------+
-| ``'u'`` | Py_UNICODE | Unicode character | 2 |
+| ``'u'`` | Py_UNICODE | Unicode character | 2 (see note) |
+-----------+----------------+-------------------+-----------------------+
| ``'h'`` | signed short | int | 2 |
+-----------+----------------+-------------------+-----------------------+
@@ -40,6 +40,11 @@ defined:
| ``'d'`` | double | float | 8 |
+-----------+----------------+-------------------+-----------------------+
+.. note::
+
+ The ``'u'`` typecode corresponds to Python's unicode character. On narrow
+ Unicode builds this is 2-bytes, on wide builds this is 4-bytes.
+
The actual representation of values is determined by the machine architecture
(strictly speaking, by the C implementation). The actual size can be accessed
through the :attr:`itemsize` attribute.
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst
index 2cf9da1..9bf374f 100644
--- a/Doc/library/ast.rst
+++ b/Doc/library/ast.rst
@@ -16,7 +16,7 @@ Python release; this module helps to find out programmatically what the current
grammar looks like.
An abstract syntax tree can be generated by passing :data:`ast.PyCF_ONLY_AST` as
-a flag to the :func:`compile` builtin function, or using the :func:`parse`
+a flag to the :func:`compile` built-in function, or using the :func:`parse`
helper provided in this module. The result will be a tree of objects whose
classes all inherit from :class:`ast.AST`. An abstract syntax tree can be
compiled into a Python code object using the built-in :func:`compile` function.
diff --git a/Doc/library/audioop.rst b/Doc/library/audioop.rst
index 4af8536..d50a970 100644
--- a/Doc/library/audioop.rst
+++ b/Doc/library/audioop.rst
@@ -222,7 +222,7 @@ The module defines the following variables and functions:
u-LAW encoding always uses 8 bits samples, so *width* refers only to the sample
width of the output fragment here.
-Note that operations such as :func:`mul` or :func:`max` make no distinction
+Note that operations such as :func:`.mul` or :func:`.max` make no distinction
between mono and stereo fragments, i.e. all samples are treated equal. If this
is a problem the stereo fragment should be split into two mono fragments first
and recombined later. Here is an example of how to do that::
diff --git a/Doc/library/cgi.rst b/Doc/library/cgi.rst
index 42acdcf..55f6509 100644
--- a/Doc/library/cgi.rst
+++ b/Doc/library/cgi.rst
@@ -132,8 +132,8 @@ commas::
If a field represents an uploaded file, accessing the value via the
:attr:`value` attribute or the :func:`getvalue` method reads the entire file in
memory as a string. This may not be what you want. You can test for an uploaded
-file by testing either the :attr:`filename` attribute or the :attr:`file`
-attribute. You can then read the data at leisure from the :attr:`file`
+file by testing either the :attr:`filename` attribute or the :attr:`!file`
+attribute. You can then read the data at leisure from the :attr:`!file`
attribute::
fileitem = form["userfile"]
@@ -153,7 +153,7 @@ field will be set to the value -1.
The file upload draft standard entertains the possibility of uploading multiple
files from one field (using a recursive :mimetype:`multipart/\*` encoding).
When this occurs, the item will be a dictionary-like :class:`FieldStorage` item.
-This can be determined by testing its :attr:`type` attribute, which should be
+This can be determined by testing its :attr:`!type` attribute, which should be
:mimetype:`multipart/form-data` (or perhaps another MIME type matching
:mimetype:`multipart/\*`). In this case, it can be iterated over recursively
just like the top-level form object.
@@ -161,7 +161,7 @@ just like the top-level form object.
When a form is submitted in the "old" format (as the query string or as a single
data part of type :mimetype:`application/x-www-form-urlencoded`), the items will
actually be instances of the class :class:`MiniFieldStorage`. In this case, the
-:attr:`list`, :attr:`file`, and :attr:`filename` attributes are always ``None``.
+:attr:`!list`, :attr:`!file`, and :attr:`filename` attributes are always ``None``.
A form submitted via POST that also has a query string will contain both
:class:`FieldStorage` and :class:`MiniFieldStorage` items.
diff --git a/Doc/library/codecs.rst b/Doc/library/codecs.rst
index 53437ce..7218d3a 100644
--- a/Doc/library/codecs.rst
+++ b/Doc/library/codecs.rst
@@ -72,9 +72,10 @@ It defines the following functions:
encoding error), ``'replace'`` (replace malformed data with a suitable
replacement marker, such as ``'?'``), ``'ignore'`` (ignore malformed data and
continue without further notice), ``'xmlcharrefreplace'`` (replace with the
- appropriate XML character reference (for encoding only)) and
- ``'backslashreplace'`` (replace with backslashed escape sequences (for encoding
- only)) as well as any other error handling name defined via
+ appropriate XML character reference (for encoding only)),
+ ``'backslashreplace'`` (replace with backslashed escape sequences (for
+ encoding only)), ``'surrogateescape'`` (replae with surrogate U+DCxx, see
+ :pep:`383`) as well as any other error handling name defined via
:func:`register_error`.
In case a search function cannot find a given encoding, it should return
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index 779f154..1d82364 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -487,7 +487,7 @@ stack manipulations such as ``dup``, ``drop``, ``swap``, ``over``, ``pick``,
.. class:: defaultdict([default_factory[, ...]])
Returns a new dictionary-like object. :class:`defaultdict` is a subclass of the
- builtin :class:`dict` class. It overrides one method and adds one writable
+ built-in :class:`dict` class. It overrides one method and adds one writable
instance variable. The remaining functionality is the same as for the
:class:`dict` class and is not documented here.
diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst
index 6f840b9..a54bc19 100644
--- a/Doc/library/configparser.rst
+++ b/Doc/library/configparser.rst
@@ -50,7 +50,7 @@ Default values can be specified by passing them into the :class:`ConfigParser`
constructor as a dictionary. Additional defaults may be passed into the
:meth:`get` method which will override all others.
-Sections are normally stored in a builtin dictionary. An alternative dictionary
+Sections are normally stored in a built-in dictionary. An alternative dictionary
type can be passed to the :class:`ConfigParser` constructor. For example, if a
dictionary type is passed that sorts its keys, the sections will be sorted on
write-back, as will be the keys within each section.
diff --git a/Doc/library/csv.rst b/Doc/library/csv.rst
index 6bcee11..7a997b0 100644
--- a/Doc/library/csv.rst
+++ b/Doc/library/csv.rst
@@ -50,7 +50,7 @@ The :mod:`csv` module defines the following functions:
Return a reader object which will iterate over lines in the given *csvfile*.
*csvfile* can be any object which supports the :term:`iterator` protocol and returns a
- string each time its :meth:`next` method is called --- file objects and list
+ string each time its :meth:`!next` method is called --- file objects and list
objects are both suitable. If *csvfile* is a file object, it should be opened
with ``newline=''``. [#]_ An optional
*dialect* parameter can be given which is used to define a set of parameters
diff --git a/Doc/library/curses.rst b/Doc/library/curses.rst
index bb750ba..4ea7afe 100644
--- a/Doc/library/curses.rst
+++ b/Doc/library/curses.rst
@@ -183,7 +183,7 @@ The module :mod:`curses` defines the following functions:
.. function:: filter()
- The :func:`filter` routine, if used, must be called before :func:`initscr` is
+ The :func:`.filter` routine, if used, must be called before :func:`initscr` is
called. The effect is that, during those calls, LINES is set to 1; the
capabilities clear, cup, cud, cud1, cuu1, cuu, vpa are disabled; and the home
string is set to the value of cr. The effect is that the cursor is confined to
@@ -606,9 +606,9 @@ the following methods:
.. note::
A *character* means a C character (an ASCII code), rather then a Python
- character (a string of length 1). (This note is true whenever the documentation
- mentions a character.) The builtin :func:`ord` is handy for conveying strings to
- codes.
+ character (a string of length 1). (This note is true whenever the
+ documentation mentions a character.) The built-in :func:`ord` is handy for
+ conveying strings to codes.
Paint character *ch* at ``(y, x)`` with attributes *attr*, overwriting any
character previously painter at that location. By default, the character
diff --git a/Doc/library/dbm.rst b/Doc/library/dbm.rst
index 7c2d660..bcb2378 100644
--- a/Doc/library/dbm.rst
+++ b/Doc/library/dbm.rst
@@ -61,7 +61,7 @@
modified by the prevailing umask).
-The object returned by :func:`open` supports most of the same functionality as
+The object returned by :func:`.open` supports most of the same functionality as
dictionaries; keys and their corresponding values can be stored, retrieved, and
deleted, and the :keyword:`in` operator and the :meth:`keys` method are
available. Key and values are always stored as bytes. This means that when
diff --git a/Doc/library/decimal.rst b/Doc/library/decimal.rst
index 7e14486..6ed3895 100644
--- a/Doc/library/decimal.rst
+++ b/Doc/library/decimal.rst
@@ -590,7 +590,7 @@ Decimal objects
.. method:: max_mag(other[, context])
- Similar to the :meth:`max` method, but the comparison is done using the
+ Similar to the :meth:`.max` method, but the comparison is done using the
absolute values of the operands.
.. method:: min(other[, context])
@@ -602,7 +602,7 @@ Decimal objects
.. method:: min_mag(other[, context])
- Similar to the :meth:`min` method, but the comparison is done using the
+ Similar to the :meth:`.min` method, but the comparison is done using the
absolute values of the operands.
.. method:: next_minus([context])
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index a999e63..198ff7b 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -514,7 +514,7 @@ are always available. They are listed here in alphabetical order.
to provide elaborate line editing and history features.
-.. function:: int([number | string[, radix]])
+.. function:: int([number | string[, base]])
Convert a number or string to an integer. If no arguments are given, return
``0``. If a number is given, return ``number.__int__()``. Conversion of
@@ -522,10 +522,10 @@ are always available. They are listed here in alphabetical order.
a base-radix integer literal optionally preceded by '+' or '-' (with no space
in between) and optionally surrounded by whitespace. A base-n literal
consists of the digits 0 to n-1, with 'a' to 'z' (or 'A' to 'Z') having
- values 10 to 35. The default radix is 10. The allowed values are 0 and 2-36.
+ values 10 to 35. The default *base* is 10. The allowed values are 0 and 2-36.
Base-2, -8, and -16 literals can be optionally prefixed with ``0b``/``0B``,
- ``0o``/``0O``, or ``0x``/``0X``, as with integer literals in code. Radix 0
- means to interpret exactly as a code literal, so that the actual radix is 2,
+ ``0o``/``0O``, or ``0x``/``0X``, as with integer literals in code. Base 0
+ means to interpret exactly as a code literal, so that the actual base is 2,
8, 10, or 16, and so that ``int('010', 0)`` is not legal, while
``int('010')`` is, as well as ``int('010', 8)``.
diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst
index 015b889..eba59c8 100644
--- a/Doc/library/gettext.rst
+++ b/Doc/library/gettext.rst
@@ -189,12 +189,12 @@ class can also install themselves in the built-in namespace as the function
.. function:: install(domain, localedir=None, codeset=None, names=None)
- This installs the function :func:`_` in Python's builtin namespace, based on
+ This installs the function :func:`_` in Python's builtins namespace, based on
*domain*, *localedir*, and *codeset* which are passed to the function
:func:`translation`.
For the *names* parameter, please see the description of the translation
- object's :meth:`install` method.
+ object's :meth:`~NullTranslations.install` method.
As seen below, you usually mark the strings in your application that are
candidates for translation, by wrapping them in a call to the :func:`_`
@@ -203,7 +203,7 @@ class can also install themselves in the built-in namespace as the function
print(_('This string will be translated.'))
For convenience, you want the :func:`_` function to be installed in Python's
- builtin namespace, so it is easily accessible in all modules of your
+ builtins namespace, so it is easily accessible in all modules of your
application.
@@ -294,7 +294,7 @@ are the methods of :class:`NullTranslations`:
binding it to ``_``.
If the *names* parameter is given, it must be a sequence containing the
- names of functions you want to install in the builtin namespace in
+ names of functions you want to install in the builtins namespace in
addition to :func:`_`. Supported names are ``'gettext'`` (bound to
:meth:`self.gettext`), ``'ngettext'`` (bound to :meth:`self.ngettext`),
``'lgettext'`` and ``'lngettext'``.
diff --git a/Doc/library/heapq.rst b/Doc/library/heapq.rst
index 6acb283..d7658ae 100644
--- a/Doc/library/heapq.rst
+++ b/Doc/library/heapq.rst
@@ -134,7 +134,7 @@ The module also offers three general purpose functions based on heaps.
The latter two functions perform best for smaller values of *n*. For larger
values, it is more efficient to use the :func:`sorted` function. Also, when
-``n==1``, it is more efficient to use the builtin :func:`min` and :func:`max`
+``n==1``, it is more efficient to use the built-in :func:`min` and :func:`max`
functions.
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
index 71d3f67..1f6f813 100644
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -12,7 +12,7 @@
.. sectionauthor:: Benjamin Peterson <benjamin@python.org>
The :mod:`io` module provides the Python interfaces to stream handling. The
-builtin :func:`open` function is defined in this module.
+built-in :func:`open` function is defined in this module.
At the top of the I/O hierarchy is the abstract base class :class:`IOBase`. It
defines the basic interface to a stream. Note, however, that there is no
@@ -39,7 +39,7 @@ buffered text interface to a buffered raw stream
stream for text.
Argument names are not part of the specification, and only the arguments of
-:func:`open` are intended to be used as keyword arguments.
+:func:`.open` are intended to be used as keyword arguments.
Module Interface
@@ -48,7 +48,7 @@ Module Interface
.. data:: DEFAULT_BUFFER_SIZE
An int containing the default buffer size used by the module's buffered I/O
- classes. :func:`open` uses the file's blksize (as obtained by
+ classes. :func:`.open` uses the file's blksize (as obtained by
:func:`os.stat`) if possible.
.. function:: open(file, mode='r', buffering=None, encoding=None, errors=None, newline=None, closefd=True)
@@ -142,8 +142,8 @@ Module Interface
closed. If a filename is given *closefd* has no effect and must be ``True``
(the default).
- The type of file object returned by the :func:`open` function depends on the
- mode. When :func:`open` is used to open a file in a text mode (``'w'``,
+ The type of file object returned by the :func:`.open` function depends on the
+ mode. When :func:`.open` is used to open a file in a text mode (``'w'``,
``'r'``, ``'wt'``, ``'rt'``, etc.), it returns a subclass of
:class:`TextIOBase` (specifically :class:`TextIOWrapper`). When used to open
a file in a binary mode with buffering, the returned class is a subclass of
@@ -256,7 +256,7 @@ I/O Base Classes
most *limit* bytes will be read.
The line terminator is always ``b'\n'`` for binary files; for text files,
- the *newlines* argument to :func:`open` can be used to select the line
+ the *newlines* argument to :func:`.open` can be used to select the line
terminator(s) recognized.
.. method:: readlines(hint=-1)
diff --git a/Doc/library/locale.rst b/Doc/library/locale.rst
index 163a383..519bd90 100644
--- a/Doc/library/locale.rst
+++ b/Doc/library/locale.rst
@@ -318,8 +318,8 @@ The :mod:`locale` module defines the following exception and functions:
.. data:: LC_NUMERIC
- Locale category for formatting numbers. The functions :func:`format`,
- :func:`atoi`, :func:`atof` and :func:`str` of the :mod:`locale` module are
+ Locale category for formatting numbers. The functions :func:`.format`,
+ :func:`atoi`, :func:`atof` and :func:`.str` of the :mod:`locale` module are
affected by that category. All other numeric formatting operations are not
affected.
@@ -504,7 +504,7 @@ document that your module is not compatible with non-\ ``C`` locale settings.
The only way to perform numeric operations according to the locale is to use the
special functions defined by this module: :func:`atof`, :func:`atoi`,
-:func:`format`, :func:`str`.
+:func:`.format`, :func:`.str`.
There is no way to perform case conversions and character classifications
according to the locale. For (Unicode) text strings these are done according
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index 82dab09..c78aeb8 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -998,7 +998,7 @@ instantiated directly, but always through the module-level function
Handles a record by passing it to all handlers associated with this logger and
its ancestors (until a false value of *propagate* is found). This method is used
for unpickled records received from a socket, as well as those created locally.
- Logger-level filtering is applied using :meth:`filter`.
+ Logger-level filtering is applied using :meth:`~Logger.filter`.
.. method:: Logger.makeRecord(name, lvl, fn, lno, msg, args, exc_info, func=None, extra=None)
diff --git a/Doc/library/multiprocessing.rst b/Doc/library/multiprocessing.rst
index d3cfa0a..43d6eb0 100644
--- a/Doc/library/multiprocessing.rst
+++ b/Doc/library/multiprocessing.rst
@@ -1552,9 +1552,9 @@ with the :class:`Pool` class.
.. method:: apply(func[, args[, kwds]])
Call *func* with arguments *args* and keyword arguments *kwds*. It blocks
- till the result is ready. Given this blocks - :meth:`apply_async` is better suited
- for performing work in parallel. Additionally, the passed
- in function is only executed in one of the workers of the pool.
+ till the result is ready. Given this blocks, :meth:`apply_async` is better
+ suited for performing work in parallel. Additionally, the passed in
+ function is only executed in one of the workers of the pool.
.. method:: apply_async(func[, args[, kwds[, callback]]])
@@ -1567,7 +1567,7 @@ with the :class:`Pool` class.
.. method:: map(func, iterable[, chunksize])
- A parallel equivalent of the :func:`map` builtin function (it supports only
+ A parallel equivalent of the :func:`map` built-in function (it supports only
one *iterable* argument though). It blocks till the result is ready.
This method chops the iterable into a number of chunks which it submits to
@@ -1576,7 +1576,7 @@ with the :class:`Pool` class.
.. method:: map_async(func, iterable[, chunksize[, callback]])
- A variant of the :meth:`map` method which returns a result object.
+ A variant of the :meth:`.map` method which returns a result object.
If *callback* is specified then it should be a callable which accepts a
single argument. When the result becomes ready *callback* is applied to
@@ -1592,7 +1592,7 @@ with the :class:`Pool` class.
make make the job complete **much** faster than using the default value of
``1``.
- Also if *chunksize* is ``1`` then the :meth:`next` method of the iterator
+ Also if *chunksize* is ``1`` then the :meth:`!next` method of the iterator
returned by the :meth:`imap` method has an optional *timeout* parameter:
``next(timeout)`` will raise :exc:`multiprocessing.TimeoutError` if the
result cannot be returned within *timeout* seconds.
diff --git a/Doc/library/numbers.rst b/Doc/library/numbers.rst
index ae14c90..2b13a79 100644
--- a/Doc/library/numbers.rst
+++ b/Doc/library/numbers.rst
@@ -22,7 +22,7 @@ The numeric tower
.. class:: Complex
Subclasses of this type describe complex numbers and include the operations
- that work on the builtin :class:`complex` type. These are: conversions to
+ that work on the built-in :class:`complex` type. These are: conversions to
:class:`complex` and :class:`bool`, :attr:`.real`, :attr:`.imag`, ``+``,
``-``, ``*``, ``/``, :func:`abs`, :meth:`conjugate`, ``==``, and ``!=``. All
except ``-`` and ``!=`` are abstract.
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst
index eae6121..961331e 100644
--- a/Doc/library/optparse.rst
+++ b/Doc/library/optparse.rst
@@ -282,7 +282,7 @@ that's rarely necessary: by default it uses ``sys.argv[1:]``.)
* ``args``, the list of positional arguments leftover after parsing options
This tutorial section only covers the four most important option attributes:
-:attr:`action`, :attr:`type`, :attr:`dest` (destination), and :attr:`help`. Of
+:attr:`action`, :attr:`!type`, :attr:`dest` (destination), and :attr:`help`. Of
these, :attr:`action` is the most fundamental.
@@ -829,7 +829,7 @@ this option on the command-line. The standard option actions hard-coded into
print a usage message including all options and the documentation for them
(If you don't supply an action, the default is ``store``. For this action, you
-may also supply :attr:`type` and :attr:`dest` option attributes; see below.)
+may also supply :attr:`!type` and :attr:`dest` option attributes; see below.)
As you can see, most actions involve storing or updating a value somewhere.
:mod:`optparse` always creates a special object for this, conventionally called
@@ -860,7 +860,7 @@ then :mod:`optparse`, on seeing this option, will do the equivalent of ::
options.filename = "foo"
-The :attr:`type` and :attr:`dest` option attributes are almost as important as
+The :attr:`!type` and :attr:`dest` option attributes are almost as important as
:attr:`action`, but :attr:`action` is the only one that makes sense for *all*
options.
@@ -875,18 +875,18 @@ Most actions have several relevant option attributes which you may specify to
guide :mod:`optparse`'s behaviour; a few have required attributes, which you
must specify for any option using that action.
-* ``store`` [relevant: :attr:`type`, :attr:`dest`, ``nargs``, ``choices``]
+* ``store`` [relevant: :attr:`!type`, :attr:`dest`, ``nargs``, ``choices``]
The option must be followed by an argument, which is converted to a value
- according to :attr:`type` and stored in :attr:`dest`. If ``nargs`` > 1,
+ according to :attr:`!type` and stored in :attr:`dest`. If ``nargs`` > 1,
multiple arguments will be consumed from the command line; all will be converted
- according to :attr:`type` and stored to :attr:`dest` as a tuple. See the
+ according to :attr:`!type` and stored to :attr:`dest` as a tuple. See the
"Option types" section below.
If ``choices`` is supplied (a list or tuple of strings), the type defaults to
``choice``.
- If :attr:`type` is not supplied, it defaults to ``string``.
+ If :attr:`!type` is not supplied, it defaults to ``string``.
If :attr:`dest` is not supplied, :mod:`optparse` derives a destination from the
first long option string (e.g., ``"--foo-bar"`` implies ``foo_bar``). If there
@@ -938,7 +938,7 @@ must specify for any option using that action.
parser.add_option("--clobber", action="store_true", dest="clobber")
parser.add_option("--no-clobber", action="store_false", dest="clobber")
-* ``append`` [relevant: :attr:`type`, :attr:`dest`, ``nargs``, ``choices``]
+* ``append`` [relevant: :attr:`!type`, :attr:`dest`, ``nargs``, ``choices``]
The option must be followed by an argument, which is appended to the list in
:attr:`dest`. If no default value for :attr:`dest` is supplied, an empty list
@@ -946,7 +946,7 @@ must specify for any option using that action.
the command-line. If ``nargs`` > 1, multiple arguments are consumed, and a
tuple of length ``nargs`` is appended to :attr:`dest`.
- The defaults for :attr:`type` and :attr:`dest` are the same as for the ``store``
+ The defaults for :attr:`!type` and :attr:`dest` are the same as for the ``store``
action.
Example::
@@ -988,7 +988,7 @@ must specify for any option using that action.
options.verbosity += 1
-* ``callback`` [required: ``callback``; relevant: :attr:`type`, ``nargs``,
+* ``callback`` [required: ``callback``; relevant: :attr:`!type`, ``nargs``,
``callback_args``, ``callback_kwargs``]
Call the function specified by ``callback``, which is called as ::
@@ -1061,7 +1061,7 @@ to a particular option, or fail to pass a required option attribute,
Determines :mod:`optparse`'s behaviour when this option is seen on the command
line; the available options are documented above.
-* :attr:`type` (default: ``"string"``)
+* :attr:`!type` (default: ``"string"``)
The argument type expected by this option (e.g., ``"string"`` or ``"int"``); the
available option types are documented below.
@@ -1079,7 +1079,7 @@ to a particular option, or fail to pass a required option attribute,
* ``nargs`` (default: 1)
- How many arguments of type :attr:`type` should be consumed when this option is
+ How many arguments of type :attr:`!type` should be consumed when this option is
seen. If > 1, :mod:`optparse` will store a tuple of values to :attr:`dest`.
* ``const``
@@ -1410,15 +1410,15 @@ The four arguments to a callback are described below.
There are several other option attributes that you can supply when you define a
callback option:
-:attr:`type`
+:attr:`!type`
has its usual meaning: as with the ``store`` or ``append`` actions, it instructs
- :mod:`optparse` to consume one argument and convert it to :attr:`type`. Rather
+ :mod:`optparse` to consume one argument and convert it to :attr:`!type`. Rather
than storing the converted value(s) anywhere, though, :mod:`optparse` passes it
to your callback function.
``nargs``
also has its usual meaning: if it is supplied and > 1, :mod:`optparse` will
- consume ``nargs`` arguments, each of which must be convertible to :attr:`type`.
+ consume ``nargs`` arguments, each of which must be convertible to :attr:`!type`.
It then passes a tuple of converted values to your callback.
``callback_args``
@@ -1450,8 +1450,8 @@ where
``value``
is the argument to this option seen on the command-line. :mod:`optparse` will
- only expect an argument if :attr:`type` is set; the type of ``value`` will be
- the type implied by the option's type. If :attr:`type` for this option is
+ only expect an argument if :attr:`!type` is set; the type of ``value`` will be
+ the type implied by the option's type. If :attr:`!type` for this option is
``None`` (no argument expected), then ``value`` will be ``None``. If ``nargs``
> 1, ``value`` will be a tuple of values of the appropriate type.
@@ -1578,7 +1578,7 @@ Callback example 5: fixed arguments
Things get slightly more interesting when you define callback options that take
a fixed number of arguments. Specifying that a callback option takes arguments
is similar to defining a ``store`` or ``append`` option: if you define
-:attr:`type`, then the option takes one argument that must be convertible to
+:attr:`!type`, then the option takes one argument that must be convertible to
that type; if you further define ``nargs``, then the option takes ``nargs``
arguments.
@@ -1757,7 +1757,7 @@ Adding new actions is a bit trickier, because you have to understand that
"typed" actions
actions that take a value from the command line and expect it to be of a certain
type; or rather, a string that can be converted to a certain type. These
- options require a :attr:`type` attribute to the Option constructor.
+ options require a :attr:`!type` attribute to the Option constructor.
These are overlapping sets: some default "store" actions are ``store``,
``store_const``, ``append``, and ``count``, while the default "typed" actions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 218437e..206a15c 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -516,10 +516,10 @@ by file descriptors.
.. note::
- This function is intended for low-level I/O. For normal usage, use the built-in
- function :func:`open`, which returns a "file object" with :meth:`~file.read` and
- :meth:`~file.write` methods (and many more). To wrap a file descriptor in a "file
- object", use :func:`fdopen`.
+ This function is intended for low-level I/O. For normal usage, use the
+ built-in function :func:`open`, which returns a "file object" with
+ :meth:`~file.read` and :meth:`~file.write` methods (and many more). To
+ wrap a file descriptor in a "file object", use :func:`fdopen`.
.. function:: openpty()
@@ -540,9 +540,9 @@ by file descriptors.
.. function:: read(fd, n)
- Read at most *n* bytes from file descriptor *fd*. Return a string containing the
+ Read at most *n* bytes from file descriptor *fd*. Return a bytestring containing the
bytes read. If the end of the file referred to by *fd* has been reached, an
- empty string is returned. Availability: Unix, Windows.
+ empty bytes object is returned. Availability: Unix, Windows.
.. note::
@@ -574,8 +574,8 @@ by file descriptors.
.. function:: write(fd, str)
- Write the string *str* to file descriptor *fd*. Return the number of bytes
- actually written. Availability: Unix, Windows.
+ Write the bytestring in *str* to file descriptor *fd*. Return the number of
+ bytes actually written. Availability: Unix, Windows.
.. note::
@@ -662,10 +662,10 @@ Files and Directories
.. note::
- Using :func:`access` to check if a user is authorized to e.g. open a file before
- actually doing so using :func:`open` creates a security hole, because the user
- might exploit the short time interval between checking and opening the file to
- manipulate it.
+ Using :func:`access` to check if a user is authorized to e.g. open a file
+ before actually doing so using :func:`open` creates a security hole,
+ because the user might exploit the short time interval between checking
+ and opening the file to manipulate it.
.. note::
diff --git a/Doc/library/ossaudiodev.rst b/Doc/library/ossaudiodev.rst
index 3ed3fb8..3972f14 100644
--- a/Doc/library/ossaudiodev.rst
+++ b/Doc/library/ossaudiodev.rst
@@ -118,7 +118,7 @@ Alternately, you can use the :meth:`setparameters` method to set all three audio
parameters at once. This is more convenient, but may not be as flexible in all
cases.
-The audio device objects returned by :func:`open` define the following methods
+The audio device objects returned by :func:`.open` define the following methods
and (read-only) attributes:
diff --git a/Doc/library/pprint.rst b/Doc/library/pprint.rst
index dd85746..d1d1bae 100644
--- a/Doc/library/pprint.rst
+++ b/Doc/library/pprint.rst
@@ -13,7 +13,7 @@ Python data structures in a form which can be used as input to the interpreter.
If the formatted structures include objects which are not fundamental Python
types, the representation may not be loadable. This may be the case if objects
such as files, sockets, classes, or instances are included, as well as many
-other builtin objects which are not representable as Python constants.
+other built-in objects which are not representable as Python constants.
The formatted representation keeps objects on a single line if it can, and
breaks them onto multiple lines if they don't fit within the allowed width.
diff --git a/Doc/library/pyclbr.rst b/Doc/library/pyclbr.rst
index a5d8494..36b46f4 100644
--- a/Doc/library/pyclbr.rst
+++ b/Doc/library/pyclbr.rst
@@ -78,7 +78,7 @@ members:
.. attribute:: Class.lineno
The line number of the ``class`` statement within the file named by
- :attr:`file`.
+ :attr:`~Class.file`.
.. _pyclbr-function-objects:
@@ -109,5 +109,5 @@ The :class:`Function` objects used as values in the dictionary returned by
.. attribute:: Function.lineno
The line number of the ``def`` statement within the file named by
- :attr:`file`.
+ :attr:`~Function.file`.
diff --git a/Doc/library/re.rst b/Doc/library/re.rst
index 5c70372..4f1528d 100644
--- a/Doc/library/re.rst
+++ b/Doc/library/re.rst
@@ -221,7 +221,7 @@ The special characters are:
flags are described in :ref:`contents-of-module-re`.) This
is useful if you wish to include the flags as part of the regular
expression, instead of passing a *flag* argument to the
- :func:`compile` function.
+ :func:`re.compile` function.
Note that the ``(?x)`` flag changes how the expression is parsed. It should be
used first in the expression string, or after one or more whitespace characters.
@@ -464,9 +464,9 @@ form.
result = re.match(pattern, string)
- but using :func:`compile` and saving the resulting regular expression object
- for reuse is more efficient when the expression will be used several times
- in a single program.
+ but using :func:`re.compile` and saving the resulting regular expression
+ object for reuse is more efficient when the expression will be used several
+ times in a single program.
.. note::
@@ -564,7 +564,7 @@ form.
.. note::
- If you want to locate a match anywhere in *string*, use :meth:`search`
+ If you want to locate a match anywhere in *string*, use :func:`search`
instead.
@@ -655,9 +655,7 @@ form.
>>> re.sub(r'\sAND\s', ' & ', 'Baked Beans And Spam', flags=re.IGNORECASE)
'Baked Beans & Spam'
- The pattern may be a string or an RE object; if you need to specify regular
- expression flags, you must use a RE object, or use embedded modifiers in a
- pattern; for example, ``sub("(?i)b+", "x", "bbbb BBBB")`` returns ``'x x'``.
+ The pattern may be a string or an RE object.
The optional argument *count* is the maximum number of pattern occurrences to be
replaced; *count* must be a non-negative integer. If omitted or zero, all
@@ -720,8 +718,8 @@ attributes:
.. note::
- If you want to locate a match anywhere in *string*, use :meth:`search`
- instead.
+ If you want to locate a match anywhere in *string*, use
+ :meth:`~RegexObject.search` instead.
The optional second parameter *pos* gives an index in the string where the
search is to start; it defaults to ``0``. This is not completely equivalent to
@@ -750,7 +748,7 @@ attributes:
is different from finding a zero-length match at some point in the string.
The optional *pos* and *endpos* parameters have the same meaning as for the
- :meth:`match` method.
+ :meth:`~RegexObject.match` method.
.. method:: RegexObject.split(string[, maxsplit=0])
@@ -814,10 +812,10 @@ support the following methods and attributes:
.. method:: MatchObject.expand(template)
Return the string obtained by doing backslash substitution on the template
- string *template*, as done by the :meth:`sub` method. Escapes such as ``\n`` are
- converted to the appropriate characters, and numeric backreferences (``\1``,
- ``\2``) and named backreferences (``\g<1>``, ``\g<name>``) are replaced by the
- contents of the corresponding group.
+ string *template*, as done by the :meth:`~RegexObject.sub` method. Escapes
+ such as ``\n`` are converted to the appropriate characters, and numeric
+ backreferences (``\1``, ``\2``) and named backreferences (``\g<1>``,
+ ``\g<name>``) are replaced by the contents of the corresponding group.
.. method:: MatchObject.group([group1, ...])
@@ -938,16 +936,16 @@ support the following methods and attributes:
.. attribute:: MatchObject.pos
- The value of *pos* which was passed to the :func:`search` or :func:`match`
- method of the :class:`RegexObject`. This is the index into the string at which
- the RE engine started looking for a match.
+ The value of *pos* which was passed to the :meth:`~RegexObject.search` or
+ :meth:`~RegexObject.match` method of the :class:`RegexObject`. This is the
+ index into the string at which the RE engine started looking for a match.
.. attribute:: MatchObject.endpos
- The value of *endpos* which was passed to the :func:`search` or :func:`match`
- method of the :class:`RegexObject`. This is the index into the string beyond
- which the RE engine will not go.
+ The value of *endpos* which was passed to the :meth:`~RegexObject.search` or
+ :meth:`~RegexObject.match` method of the :class:`RegexObject`. This is the
+ index into the string beyond which the RE engine will not go.
.. attribute:: MatchObject.lastindex
@@ -967,13 +965,15 @@ support the following methods and attributes:
.. attribute:: MatchObject.re
- The regular expression object whose :meth:`match` or :meth:`search` method
- produced this :class:`MatchObject` instance.
+ The regular expression object whose :meth:`~RegexObject.match` or
+ :meth:`~RegexObject.search` method produced this :class:`MatchObject`
+ instance.
.. attribute:: MatchObject.string
- The string passed to :func:`match` or :func:`search`.
+ The string passed to :meth:`~RegexObject.match` or
+ :meth:`~RegexObject.search`.
Examples
@@ -1018,8 +1018,9 @@ To match this with a regular expression, one could use backreferences as such:
>>> displaymatch(pair.match("354aa")) # Pair of aces.
"<Match: '354aa', groups=('a',)>"
-To find out what card the pair consists of, one could use the :func:`group`
-method of :class:`MatchObject` in the following manner:
+To find out what card the pair consists of, one could use the
+:meth:`~MatchObject.group` method of :class:`MatchObject` in the following
+manner:
.. doctest::
diff --git a/Doc/library/reprlib.rst b/Doc/library/reprlib.rst
index 0da29fc..17a6ac4 100644
--- a/Doc/library/reprlib.rst
+++ b/Doc/library/reprlib.rst
@@ -23,16 +23,17 @@ This module provides a class, an instance, and a function:
.. data:: aRepr
- This is an instance of :class:`Repr` which is used to provide the :func:`repr`
- function described below. Changing the attributes of this object will affect
- the size limits used by :func:`repr` and the Python debugger.
+ This is an instance of :class:`Repr` which is used to provide the
+ :func:`.repr` function described below. Changing the attributes of this
+ object will affect the size limits used by :func:`.repr` and the Python
+ debugger.
.. function:: repr(obj)
- This is the :meth:`repr` method of ``aRepr``. It returns a string similar to
- that returned by the built-in function of the same name, but with limits on
- most sizes.
+ This is the :meth:`~Repr.repr` method of ``aRepr``. It returns a string
+ similar to that returned by the built-in function of the same name, but with
+ limits on most sizes.
.. _repr-objects:
@@ -92,7 +93,7 @@ which format specific object types.
.. method:: Repr.repr1(obj, level)
- Recursive implementation used by :meth:`repr`. This uses the type of *obj* to
+ Recursive implementation used by :meth:`.repr`. This uses the type of *obj* to
determine which formatting method to call, passing it *obj* and *level*. The
type-specific methods should call :meth:`repr1` to perform recursive formatting,
with ``level - 1`` for the value of *level* in the recursive call.
diff --git a/Doc/library/select.rst b/Doc/library/select.rst
index 6dbf16f..73e8cd9 100644
--- a/Doc/library/select.rst
+++ b/Doc/library/select.rst
@@ -299,7 +299,7 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
.. attribute:: kevent.filter
- Name of the kernel filter
+ Name of the kernel filter.
+---------------------------+---------------------------------------------+
| Constant | Meaning |
@@ -308,7 +308,7 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
| | there is data available to read |
+---------------------------+---------------------------------------------+
| :const:`KQ_FILTER_WRITE` | Takes a descriptor and returns whenever |
- | | there is data available to read |
+ | | there is data available to write |
+---------------------------+---------------------------------------------+
| :const:`KQ_FILTER_AIO` | AIO requests |
+---------------------------+---------------------------------------------+
@@ -328,7 +328,7 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
.. attribute:: kevent.flags
- Filter action
+ Filter action.
+---------------------------+---------------------------------------------+
| Constant | Meaning |
@@ -357,10 +357,9 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
.. attribute:: kevent.fflags
- Filter specific flags
-
+ Filter specific flags.
- :const:`KQ_FILTER_READ` and :const:`KQ_FILTER_WRITE` filter flags
+ :const:`KQ_FILTER_READ` and :const:`KQ_FILTER_WRITE` filter flags:
+----------------------------+--------------------------------------------+
| Constant | Meaning |
@@ -368,8 +367,7 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
| :const:`KQ_NOTE_LOWAT` | low water mark of a socket buffer |
+----------------------------+--------------------------------------------+
-
- :const:`KQ_FILTER_VNODE` filter flags
+ :const:`KQ_FILTER_VNODE` filter flags:
+----------------------------+--------------------------------------------+
| Constant | Meaning |
@@ -389,8 +387,7 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
| :const:`KQ_NOTE_REVOKE` | access to the file was revoked |
+----------------------------+--------------------------------------------+
-
- :const:`KQ_FILTER_PROC` filter flags
+ :const:`KQ_FILTER_PROC` filter flags:
+----------------------------+--------------------------------------------+
| Constant | Meaning |
@@ -413,7 +410,7 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
| :const:`KQ_NOTE_TRACKERR` | unable to attach to a child |
+----------------------------+--------------------------------------------+
- :const:`KQ_FILTER_NETDEV` filter flags [not available on Mac OS X]
+ :const:`KQ_FILTER_NETDEV` filter flags (not available on Mac OS X):
+----------------------------+--------------------------------------------+
| Constant | Meaning |
@@ -428,9 +425,9 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2
.. attribute:: kevent.data
- Filter specific data
+ Filter specific data.
.. attribute:: kevent.udata
- User defined value
+ User defined value.
diff --git a/Doc/library/shelve.rst b/Doc/library/shelve.rst
index 62005a4..35ed84c 100644
--- a/Doc/library/shelve.rst
+++ b/Doc/library/shelve.rst
@@ -101,7 +101,7 @@ Restrictions
.. class:: BsdDbShelf(dict[, protocol=None[, writeback=False]])
- A subclass of :class:`Shelf` which exposes :meth:`first`, :meth:`next`,
+ A subclass of :class:`Shelf` which exposes :meth:`first`, :meth:`!next`,
:meth:`previous`, :meth:`last` and :meth:`set_location` which are available
in the third-party :mod:`bsddb` module from `pybsddb
<http://www.jcea.es/programacion/pybsddb.htm>`_ but not in other database
@@ -117,7 +117,7 @@ Restrictions
A subclass of :class:`Shelf` which accepts a *filename* instead of a dict-like
object. The underlying file will be opened using :func:`dbm.open`. By
default, the file will be created and opened for both read and write. The
- optional *flag* parameter has the same interpretation as for the :func:`open`
+ optional *flag* parameter has the same interpretation as for the :func:`.open`
function. The optional *protocol* and *writeback* parameters have the same
interpretation as for the :class:`Shelf` class.
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
index cda8fee..e6ad578 100644
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -555,6 +555,8 @@ correspond to Unix system calls applicable to sockets.
The :meth:`ioctl` method is a limited interface to the WSAIoctl system
interface. Please refer to the MSDN documentation for more information.
+ On other platforms, the generic :func:`fcntl.fcntl` and :func:`fcntl.ioctl`
+ functions may be used; they accept a socket object as their first argument.
.. method:: socket.listen(backlog)
diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst
index 53164b8..a4d9c7f 100644
--- a/Doc/library/sqlite3.rst
+++ b/Doc/library/sqlite3.rst
@@ -822,7 +822,7 @@ directly using only a single call on the :class:`Connection` object.
Accessing columns by name instead of by index
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-One useful feature of the :mod:`sqlite3` module is the builtin
+One useful feature of the :mod:`sqlite3` module is the built-in
:class:`sqlite3.Row` class designed to be used as a row factory.
Rows wrapped with this class can be accessed both by index (like tuples) and
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 1ccc457..14ad15e 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -120,25 +120,24 @@ Notes:
Comparisons
===========
-.. index:: pair: chaining; comparisons
-
-There are eight comparison operations in Python. They all have the same
-priority (which is higher than that of the Boolean operations). Comparisons can
-be chained arbitrarily; for example, ``x < y <= z`` is equivalent to ``x < y and
-y <= z``, except that *y* is evaluated only once (but in both cases *z* is not
-evaluated at all when ``x < y`` is found to be false).
-
.. index::
+ pair: chaining; comparisons
pair: operator; comparison
operator: ==
operator: <
- operator: >
operator: <=
+ operator: >
operator: >=
operator: !=
operator: is
operator: is not
+There are eight comparison operations in Python. They all have the same
+priority (which is higher than that of the Boolean operations). Comparisons can
+be chained arbitrarily; for example, ``x < y <= z`` is equivalent to ``x < y and
+y <= z``, except that *y* is evaluated only once (but in both cases *z* is not
+evaluated at all when ``x < y`` is found to be false).
+
This table summarizes the comparison operations:
+------------+-------------------------+
@@ -248,6 +247,13 @@ and imaginary parts.
builtin: int
builtin: float
builtin: complex
+ operator: +
+ operator: -
+ operator: *
+ operator: /
+ operator: //
+ operator: %
+ operator: **
Python fully supports mixed arithmetic: when a binary arithmetic operator has
operands of different numeric types, the operand with the "narrower" type is
@@ -368,7 +374,15 @@ modules.
Bit-string Operations on Integer Types
--------------------------------------
-.. _bit-string-operations:
+.. index::
+ triple: operations on; integer; types
+ pair: bit-string; operations
+ pair: shifting; operations
+ pair: masking; operations
+ operator: ^
+ operator: &
+ operator: <<
+ operator: >>
Integers support additional operations that make sense only for bit-strings.
Negative numbers are treated as their 2's complement value (this assumes a
@@ -400,12 +414,6 @@ This table lists the bit-string operations sorted in ascending priority
| ``~x`` | the bits of *x* inverted | |
+------------+--------------------------------+----------+
-.. index::
- triple: operations on; integer; types
- pair: bit-string; operations
- pair: shifting; operations
- pair: masking; operations
-
Notes:
(1)
@@ -1595,7 +1603,7 @@ set``. Being an unordered collection, sets do not record element position or
order of insertion. Accordingly, sets do not support indexing, slicing, or
other sequence-like behavior.
-There are currently two builtin set types, :class:`set` and :class:`frozenset`.
+There are currently two built-in set types, :class:`set` and :class:`frozenset`.
The :class:`set` type is mutable --- the contents can be changed using methods
like :meth:`add` and :meth:`remove`. Since it is mutable, it has no hash value
and cannot be used as either a dictionary key or as an element of another set.
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 215e76d..95d27f1 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -287,7 +287,7 @@ Format Specification Mini-Language
"Format specifications" are used within replacement fields contained within a
format string to define how individual values are presented (see
-:ref:`formatstrings`.) They can also be passed directly to the builtin
+:ref:`formatstrings`.) They can also be passed directly to the built-in
:func:`format` function. Each formattable type may define how the format
specification is to be interpreted.
diff --git a/Doc/library/sunau.rst b/Doc/library/sunau.rst
index 9930133..3f231b4 100644
--- a/Doc/library/sunau.rst
+++ b/Doc/library/sunau.rst
@@ -58,18 +58,18 @@ The :mod:`sunau` module defines the following functions:
.. function:: openfp(file, mode)
- A synonym for :func:`open`, maintained for backwards compatibility.
+ A synonym for :func:`.open`, maintained for backwards compatibility.
-The :mod:`sunau` module defines the following exception:
+The :mod:`sunau` module defines the following exception:
.. exception:: Error
An error raised when something is impossible because of Sun AU specs or
implementation deficiency.
-The :mod:`sunau` module defines the following data items:
+The :mod:`sunau` module defines the following data items:
.. data:: AUDIO_FILE_MAGIC
@@ -104,7 +104,7 @@ The :mod:`sunau` module defines the following data items:
AU_read Objects
---------------
-AU_read objects, as returned by :func:`open` above, have the following methods:
+AU_read objects, as returned by :func:`.open` above, have the following methods:
.. method:: AU_read.close()
@@ -197,7 +197,7 @@ and don't do anything interesting.
AU_write Objects
----------------
-AU_write objects, as returned by :func:`open` above, have the following methods:
+AU_write objects, as returned by :func:`.open` above, have the following methods:
.. method:: AU_write.setnchannels(n)
diff --git a/Doc/library/sys.rst b/Doc/library/sys.rst
index ba22dc3..d28f6b4 100644
--- a/Doc/library/sys.rst
+++ b/Doc/library/sys.rst
@@ -736,7 +736,7 @@ always available.
``'c_call'``
A C function is about to be called. This may be an extension function or
- a builtin. *arg* is the C function object.
+ a built-in. *arg* is the C function object.
``'c_return'``
A C function has returned. *arg* is ``None``.
diff --git a/Doc/library/tempfile.rst b/Doc/library/tempfile.rst
index 36c8753..722c5ee 100644
--- a/Doc/library/tempfile.rst
+++ b/Doc/library/tempfile.rst
@@ -48,7 +48,7 @@ The module defines the following user-callable functions:
The *dir*, *prefix* and *suffix* parameters are passed to :func:`mkstemp`.
The returned object is a true file object on POSIX platforms. On other
- platforms, it is a file-like object whose :attr:`file` attribute is the
+ platforms, it is a file-like object whose :attr:`!file` attribute is the
underlying true file object. This file-like object can be used in a
:keyword:`with` statement, just like a normal file.
@@ -63,7 +63,7 @@ The module defines the following user-callable functions:
still open, varies across platforms (it can be so used on Unix; it cannot
on Windows NT or later). If *delete* is true (the default), the file is
deleted as soon as it is closed.
- The returned object is always a file-like object whose :attr:`file`
+ The returned object is always a file-like object whose :attr:`!file`
attribute is the underlying true file object. This file-like object can
be used in a :keyword:`with` statement, just like a normal file.
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst
index d880157..86a9bf8 100644
--- a/Doc/library/threading.rst
+++ b/Doc/library/threading.rst
@@ -1,4 +1,3 @@
-
:mod:`threading` --- Higher-level threading interface
=====================================================
@@ -55,8 +54,9 @@ This module defines the following functions and objects:
:noindex:
A factory function that returns a new event object. An event manages a flag
- that can be set to true with the :meth:`set` method and reset to false with the
- :meth:`clear` method. The :meth:`wait` method blocks until the flag is true.
+ that can be set to true with the :meth:`~Event.set` method and reset to false
+ with the :meth:`clear` method. The :meth:`wait` method blocks until the flag
+ is true.
.. class:: local
@@ -213,7 +213,8 @@ impossible to detect the termination of alien threads.
.. class:: Thread(group=None, target=None, name=None, args=(), kwargs={})
- This constructor should always be called with keyword arguments. Arguments are:
+ This constructor should always be called with keyword arguments. Arguments
+ are:
*group* should be ``None``; reserved for future extension when a
:class:`ThreadGroup` class is implemented.
@@ -221,111 +222,103 @@ impossible to detect the termination of alien threads.
*target* is the callable object to be invoked by the :meth:`run` method.
Defaults to ``None``, meaning nothing is called.
- *name* is the thread name. By default, a unique name is constructed of the form
- "Thread-*N*" where *N* is a small decimal number.
+ *name* is the thread name. By default, a unique name is constructed of the
+ form "Thread-*N*" where *N* is a small decimal number.
*args* is the argument tuple for the target invocation. Defaults to ``()``.
*kwargs* is a dictionary of keyword arguments for the target invocation.
Defaults to ``{}``.
- If the subclass overrides the constructor, it must make sure to invoke the base
- class constructor (``Thread.__init__()``) before doing anything else to the
- thread.
-
-
-.. method:: Thread.start()
-
- Start the thread's activity.
-
- It must be called at most once per thread object. It arranges for the object's
- :meth:`run` method to be invoked in a separate thread of control.
+ If the subclass overrides the constructor, it must make sure to invoke the
+ base class constructor (``Thread.__init__()``) before doing anything else to
+ the thread.
- This method will raise a :exc:`RuntimeException` if called more than once on the
- same thread object.
+ .. method:: start()
+ Start the thread's activity.
-.. method:: Thread.run()
+ It must be called at most once per thread object. It arranges for the
+ object's :meth:`run` method to be invoked in a separate thread of control.
- Method representing the thread's activity.
+ This method will raise a :exc:`RuntimeException` if called more than once
+ on the same thread object.
- You may override this method in a subclass. The standard :meth:`run` method
- invokes the callable object passed to the object's constructor as the *target*
- argument, if any, with sequential and keyword arguments taken from the *args*
- and *kwargs* arguments, respectively.
+ .. method:: run()
+ Method representing the thread's activity.
-.. method:: Thread.join([timeout])
+ You may override this method in a subclass. The standard :meth:`run`
+ method invokes the callable object passed to the object's constructor as
+ the *target* argument, if any, with sequential and keyword arguments taken
+ from the *args* and *kwargs* arguments, respectively.
- Wait until the thread terminates. This blocks the calling thread until the
- thread whose :meth:`join` method is called terminates -- either normally or
- through an unhandled exception -- or until the optional timeout occurs.
+ .. method:: join([timeout])
- When the *timeout* argument is present and not ``None``, it should be a floating
- point number specifying a timeout for the operation in seconds (or fractions
- thereof). As :meth:`join` always returns ``None``, you must call :meth:`is_alive`
- after :meth:`join` to decide whether a timeout happened -- if the thread is
- still alive, the :meth:`join` call timed out.
+ Wait until the thread terminates. This blocks the calling thread until the
+ thread whose :meth:`join` method is called terminates -- either normally
+ or through an unhandled exception -- or until the optional timeout occurs.
- When the *timeout* argument is not present or ``None``, the operation will block
- until the thread terminates.
+ When the *timeout* argument is present and not ``None``, it should be a
+ floating point number specifying a timeout for the operation in seconds
+ (or fractions thereof). As :meth:`join` always returns ``None``, you must
+ call :meth:`is_alive` after :meth:`join` to decide whether a timeout
+ happened -- if the thread is still alive, the :meth:`join` call timed out.
- A thread can be :meth:`join`\ ed many times.
+ When the *timeout* argument is not present or ``None``, the operation will
+ block until the thread terminates.
- :meth:`join` raises a :exc:`RuntimeError` if an attempt is made to join
- the current thread as that would cause a deadlock. It is also an error to
- :meth:`join` a thread before it has been started and attempts to do so
- raises the same exception.
+ A thread can be :meth:`join`\ ed many times.
+ :meth:`join` raises a :exc:`RuntimeError` if an attempt is made to join
+ the current thread as that would cause a deadlock. It is also an error to
+ :meth:`join` a thread before it has been started and attempts to do so
+ raises the same exception.
-.. attribute:: Thread.name
+ .. attribute:: name
- A string used for identification purposes only. It has no semantics.
- Multiple threads may be given the same name. The initial name is set by the
- constructor.
+ A string used for identification purposes only. It has no semantics.
+ Multiple threads may be given the same name. The initial name is set by
+ the constructor.
+ .. method:: getName()
+ setName()
-.. method:: Thread.getName()
- Thread.setName()
+ Old getter/setter API for :attr:`~Thread.name`; use it directly as a
+ property instead.
- Old getter/setter API for :attr:`~Thread.name`; use it directly as a property
- instead.
+ .. attribute:: ident
+ The 'thread identifier' of this thread or ``None`` if the thread has not
+ been started. This is a nonzero integer. See the
+ :func:`thread.get_ident()` function. Thread identifiers may be recycled
+ when a thread exits and another thread is created. The identifier is
+ available even after the thread has exited.
-.. attribute:: Thread.ident
+ .. method:: is_alive()
- The 'thread identifier' of this thread or ``None`` if the thread has not been
- started. This is a nonzero integer. See the :func:`thread.get_ident()`
- function. Thread identifiers may be recycled when a thread exits and another
- thread is created. The identifier is available even after the thread has
- exited.
+ Return whether the thread is alive.
+ Roughly, a thread is alive from the moment the :meth:`start` method
+ returns until its :meth:`run` method terminates. The module function
+ :func:`enumerate` returns a list of all alive threads.
-.. method:: Thread.is_alive()
+ .. attribute:: daemon
- Return whether the thread is alive.
+ A boolean value indicating whether this thread is a daemon thread (True)
+ or not (False). This must be set before :meth:`start` is called,
+ otherwise :exc:`RuntimeError` is raised. Its initial value is inherited
+ from the creating thread; the main thread is not a daemon thread and
+ therefore all threads created in the main thread default to :attr:`daemon`
+ = ``False``.
- Roughly, a thread is alive from the moment the :meth:`start` method returns
- until its :meth:`run` method terminates. The module function :func:`enumerate`
- returns a list of all alive threads.
+ The entire Python program exits when no alive non-daemon threads are left.
+ .. method:: isDaemon()
+ setDaemon()
-.. attribute:: Thread.daemon
-
- A boolean value indicating whether this thread is a daemon thread (True) or
- not (False). This must be set before :meth:`start` is called, otherwise
- :exc:`RuntimeError` is raised. Its initial value is inherited from the
- creating thread; the main thread is not a daemon thread and therefore all
- threads created in the main thread default to :attr:`daemon` = ``False``.
-
- The entire Python program exits when no alive non-daemon threads are left.
-
-
-.. method:: Thread.isDaemon()
- Thread.setDaemon()
-
- Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a
- property instead.
+ Old getter/setter API for :attr:`~Thread.daemon`; use it directly as a
+ property instead.
.. _lock-objects:
@@ -496,69 +489,66 @@ needs to wake up one consumer thread.
.. class:: Condition([lock])
- If the *lock* argument is given and not ``None``, it must be a :class:`Lock` or
- :class:`RLock` object, and it is used as the underlying lock. Otherwise, a new
- :class:`RLock` object is created and used as the underlying lock.
-
+ If the *lock* argument is given and not ``None``, it must be a :class:`Lock`
+ or :class:`RLock` object, and it is used as the underlying lock. Otherwise,
+ a new :class:`RLock` object is created and used as the underlying lock.
-.. method:: Condition.acquire(*args)
+ .. method:: acquire(*args)
- Acquire the underlying lock. This method calls the corresponding method on the
- underlying lock; the return value is whatever that method returns.
+ Acquire the underlying lock. This method calls the corresponding method on
+ the underlying lock; the return value is whatever that method returns.
+ .. method:: release()
-.. method:: Condition.release()
+ Release the underlying lock. This method calls the corresponding method on
+ the underlying lock; there is no return value.
- Release the underlying lock. This method calls the corresponding method on the
- underlying lock; there is no return value.
+ .. method:: wait([timeout])
+ Wait until notified or until a timeout occurs. If the calling thread has
+ not acquired the lock when this method is called, a :exc:`RuntimeError` is
+ raised.
-.. method:: Condition.wait([timeout])
+ This method releases the underlying lock, and then blocks until it is
+ awakened by a :meth:`notify` or :meth:`notify_all` call for the same
+ condition variable in another thread, or until the optional timeout
+ occurs. Once awakened or timed out, it re-acquires the lock and returns.
- Wait until notified or until a timeout occurs. If the calling thread has not
- acquired the lock when this method is called, a :exc:`RuntimeError` is raised.
+ When the *timeout* argument is present and not ``None``, it should be a
+ floating point number specifying a timeout for the operation in seconds
+ (or fractions thereof).
- This method releases the underlying lock, and then blocks until it is awakened
- by a :meth:`notify` or :meth:`notify_all` call for the same condition variable in
- another thread, or until the optional timeout occurs. Once awakened or timed
- out, it re-acquires the lock and returns.
+ When the underlying lock is an :class:`RLock`, it is not released using
+ its :meth:`release` method, since this may not actually unlock the lock
+ when it was acquired multiple times recursively. Instead, an internal
+ interface of the :class:`RLock` class is used, which really unlocks it
+ even when it has been recursively acquired several times. Another internal
+ interface is then used to restore the recursion level when the lock is
+ reacquired.
- When the *timeout* argument is present and not ``None``, it should be a floating
- point number specifying a timeout for the operation in seconds (or fractions
- thereof).
+ .. method:: notify()
- When the underlying lock is an :class:`RLock`, it is not released using its
- :meth:`release` method, since this may not actually unlock the lock when it was
- acquired multiple times recursively. Instead, an internal interface of the
- :class:`RLock` class is used, which really unlocks it even when it has been
- recursively acquired several times. Another internal interface is then used to
- restore the recursion level when the lock is reacquired.
+ Wake up a thread waiting on this condition, if any. If the calling thread
+ has not acquired the lock when this method is called, a
+ :exc:`RuntimeError` is raised.
+ This method wakes up one of the threads waiting for the condition
+ variable, if any are waiting; it is a no-op if no threads are waiting.
-.. method:: Condition.notify()
+ The current implementation wakes up exactly one thread, if any are
+ waiting. However, it's not safe to rely on this behavior. A future,
+ optimized implementation may occasionally wake up more than one thread.
- Wake up a thread waiting on this condition, if any. If the calling thread
- has not acquired the lock when this method is called, a :exc:`RuntimeError`
- is raised.
+ Note: the awakened thread does not actually return from its :meth:`wait`
+ call until it can reacquire the lock. Since :meth:`notify` does not
+ release the lock, its caller should.
- This method wakes up one of the threads waiting for the condition variable,
- if any are waiting; it is a no-op if no threads are waiting.
+ .. method:: notify_all()
- The current implementation wakes up exactly one thread, if any are waiting.
- However, it's not safe to rely on this behavior. A future, optimized
- implementation may occasionally wake up more than one thread.
-
- Note: the awakened thread does not actually return from its :meth:`wait` call
- until it can reacquire the lock. Since :meth:`notify` does not release the
- lock, its caller should.
-
-
-.. method:: Condition.notify_all()
-
- Wake up all threads waiting on this condition. This method acts like
- :meth:`notify`, but wakes up all waiting threads instead of one. If the calling
- thread has not acquired the lock when this method is called, a
- :exc:`RuntimeError` is raised.
+ Wake up all threads waiting on this condition. This method acts like
+ :meth:`notify`, but wakes up all waiting threads instead of one. If the
+ calling thread has not acquired the lock when this method is called, a
+ :exc:`RuntimeError` is raised.
.. _semaphore-objects:
@@ -582,33 +572,31 @@ waiting until some other thread calls :meth:`release`.
defaults to ``1``. If the *value* given is less than 0, :exc:`ValueError` is
raised.
+ .. method:: acquire([blocking])
-.. method:: Semaphore.acquire([blocking])
-
- Acquire a semaphore.
-
- When invoked without arguments: if the internal counter is larger than zero on
- entry, decrement it by one and return immediately. If it is zero on entry,
- block, waiting until some other thread has called :meth:`release` to make it
- larger than zero. This is done with proper interlocking so that if multiple
- :meth:`acquire` calls are blocked, :meth:`release` will wake exactly one of them
- up. The implementation may pick one at random, so the order in which blocked
- threads are awakened should not be relied on. There is no return value in this
- case.
+ Acquire a semaphore.
- When invoked with *blocking* set to true, do the same thing as when called
- without arguments, and return true.
+ When invoked without arguments: if the internal counter is larger than
+ zero on entry, decrement it by one and return immediately. If it is zero
+ on entry, block, waiting until some other thread has called
+ :meth:`release` to make it larger than zero. This is done with proper
+ interlocking so that if multiple :meth:`acquire` calls are blocked,
+ :meth:`release` will wake exactly one of them up. The implementation may
+ pick one at random, so the order in which blocked threads are awakened
+ should not be relied on. There is no return value in this case.
- When invoked with *blocking* set to false, do not block. If a call without an
- argument would block, return false immediately; otherwise, do the same thing as
- when called without arguments, and return true.
+ When invoked with *blocking* set to true, do the same thing as when called
+ without arguments, and return true.
+ When invoked with *blocking* set to false, do not block. If a call
+ without an argument would block, return false immediately; otherwise, do
+ the same thing as when called without arguments, and return true.
-.. method:: Semaphore.release()
+ .. method:: release()
- Release a semaphore, incrementing the internal counter by one. When it was zero
- on entry and another thread is waiting for it to become larger than zero again,
- wake up that thread.
+ Release a semaphore, incrementing the internal counter by one. When it
+ was zero on entry and another thread is waiting for it to become larger
+ than zero again, wake up that thread.
.. _semaphore-examples:
@@ -647,7 +635,7 @@ This is one of the simplest mechanisms for communication between threads: one
thread signals an event and other threads wait for it.
An event object manages an internal flag that can be set to true with the
-:meth:`set` method and reset to false with the :meth:`clear` method. The
+:meth:`~Event.set` method and reset to false with the :meth:`clear` method. The
:meth:`wait` method blocks until the flag is true.
@@ -655,40 +643,37 @@ An event object manages an internal flag that can be set to true with the
The internal flag is initially false.
+ .. method:: is_set()
-.. method:: Event.is_set()
+ Return true if and only if the internal flag is true.
- Return true if and only if the internal flag is true.
+ .. method:: set()
+ Set the internal flag to true. All threads waiting for it to become true
+ are awakened. Threads that call :meth:`wait` once the flag is true will
+ not block at all.
-.. method:: Event.set()
+ .. method:: clear()
- Set the internal flag to true. All threads waiting for it to become true are
- awakened. Threads that call :meth:`wait` once the flag is true will not block at
- all.
+ Reset the internal flag to false. Subsequently, threads calling
+ :meth:`wait` will block until :meth:`.set` is called to set the internal
+ flag to true again.
+ .. method:: wait([timeout])
-.. method:: Event.clear()
+ Block until the internal flag is true. If the internal flag is true on
+ entry, return immediately. Otherwise, block until another thread calls
+ :meth:`set` to set the flag to true, or until the optional timeout occurs.
- Reset the internal flag to false. Subsequently, threads calling :meth:`wait`
- will block until :meth:`set` is called to set the internal flag to true again.
+ When the timeout argument is present and not ``None``, it should be a
+ floating point number specifying a timeout for the operation in seconds
+ (or fractions thereof).
+ This method returns the internal flag on exit, so it will always return
+ ``True`` except if a timeout is given and the operation times out.
-.. method:: Event.wait([timeout])
-
- Block until the internal flag is true. If the internal flag is true on entry,
- return immediately. Otherwise, block until another thread calls :meth:`set`
- to set the flag to true, or until the optional timeout occurs.
-
- When the timeout argument is present and not ``None``, it should be a floating
- point number specifying a timeout for the operation in seconds (or fractions
- thereof).
-
- This method returns the internal flag on exit, so it will always return
- ``True`` except if a timeout is given and the operation times out.
-
- .. versionchanged:: 3.1
- Previously, the method always returned ``None``.
+ .. versionchanged:: 3.1
+ Previously, the method always returned ``None``.
.. _timer-objects:
@@ -719,11 +704,10 @@ For example::
Create a timer that will run *function* with arguments *args* and keyword
arguments *kwargs*, after *interval* seconds have passed.
+ .. method:: cancel()
-.. method:: Timer.cancel()
-
- Stop the timer, and cancel the execution of the timer's action. This will only
- work if the timer is still in its waiting stage.
+ Stop the timer, and cancel the execution of the timer's action. This will
+ only work if the timer is still in its waiting stage.
.. _with-locks:
diff --git a/Doc/library/tkinter.rst b/Doc/library/tkinter.rst
index 7413987..74e3fbb 100644
--- a/Doc/library/tkinter.rst
+++ b/Doc/library/tkinter.rst
@@ -511,7 +511,7 @@ defined in the :mod:`tkinter`.
There are many useful subclasses of Variable already defined:
:class:`StringVar`, :class:`IntVar`, :class:`DoubleVar`, and
:class:`BooleanVar`. To read the current value of such a variable, call the
-:meth:`get` method on it, and to change its value you call the :meth:`set`
+:meth:`get` method on it, and to change its value you call the :meth:`!set`
method. If you follow this protocol, the widget will always track the value of
the variable, with no further intervention on your part.
@@ -652,7 +652,7 @@ relief
``"raised"``, ``"sunken"``, ``"flat"``, ``"groove"``, and ``"ridge"``.
scrollcommand
- This is almost always the :meth:`set` method of some scrollbar widget, but can
+ This is almost always the :meth:`!set` method of some scrollbar widget, but can
be any widget method that takes a single argument. Refer to the file
:file:`Demo/tkinter/matt/canvas-with-scrollbars.py` in the Python source
distribution for an example.
diff --git a/Doc/library/undoc.rst b/Doc/library/undoc.rst
index 987f95e..6dd1aed 100644
--- a/Doc/library/undoc.rst
+++ b/Doc/library/undoc.rst
@@ -25,4 +25,3 @@ documented beyond this mention. There's little need to document these.
:mod:`posixpath`
--- Implementation of :mod:`os.path` on POSIX.
-
diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst
index 28fa66f..161614b 100644
--- a/Doc/library/urllib.parse.rst
+++ b/Doc/library/urllib.parse.rst
@@ -249,9 +249,9 @@ The :mod:`urllib.parse` module defines the following functions:
.. function:: quote_plus(string[, safe[, encoding[, errors]]])
Like :func:`quote`, but also replace spaces by plus signs, as required for
- quoting HTML form values. Plus signs in the original string are escaped
- unless they are included in *safe*. It also does not have *safe* default to
- ``'/'``.
+ quoting HTML form values when building up a query string to go into a URL.
+ Plus signs in the original string are escaped unless they are included in
+ *safe*. It also does not have *safe* default to ``'/'``.
Example: ``quote_plus('/El NiƱo/')`` yields ``'%2FEl+Ni%C3%B1o%2F'``.
diff --git a/Doc/library/warnings.rst b/Doc/library/warnings.rst
index f6856ff..1574e27 100644
--- a/Doc/library/warnings.rst
+++ b/Doc/library/warnings.rst
@@ -206,7 +206,7 @@ check::
fxn()
# Verify some things
assert len(w) == 1
- assert isinstance(w[-1].category, DeprecationWarning)
+ assert issubclass(w[-1].category, DeprecationWarning)
assert "deprecated" in str(w[-1].message)
One can also cause all warnings to be exceptions by using ``error`` instead of
diff --git a/Doc/library/wave.rst b/Doc/library/wave.rst
index b931fed..3be0343 100644
--- a/Doc/library/wave.rst
+++ b/Doc/library/wave.rst
@@ -33,7 +33,7 @@ The :mod:`wave` module defines the following function and exception:
.. function:: openfp(file, mode)
- A synonym for :func:`open`, maintained for backwards compatibility.
+ A synonym for :func:`.open`, maintained for backwards compatibility.
.. exception:: Error
@@ -47,7 +47,7 @@ The :mod:`wave` module defines the following function and exception:
Wave_read Objects
-----------------
-Wave_read objects, as returned by :func:`open`, have the following methods:
+Wave_read objects, as returned by :func:`.open`, have the following methods:
.. method:: Wave_read.close()
@@ -134,7 +134,7 @@ them, and is otherwise implementation dependent.
Wave_write Objects
------------------
-Wave_write objects, as returned by :func:`open`, have the following methods:
+Wave_write objects, as returned by :func:`.open`, have the following methods:
.. method:: Wave_write.close()
diff --git a/Doc/library/weakref.rst b/Doc/library/weakref.rst
index 0f3ebe6..7c7be95 100644
--- a/Doc/library/weakref.rst
+++ b/Doc/library/weakref.rst
@@ -62,7 +62,7 @@ instances, functions written in Python (but not in C), instance methods, sets,
frozensets, file objects, :term:`generator`\s, type objects, sockets, arrays,
deques, and regular expression pattern objects.
-Several builtin types such as :class:`list` and :class:`dict` do not directly
+Several built-in types such as :class:`list` and :class:`dict` do not directly
support weak references but can add support through subclassing::
class Dict(dict):
diff --git a/Doc/library/webbrowser.rst b/Doc/library/webbrowser.rst
index 975d668..01720d1 100644
--- a/Doc/library/webbrowser.rst
+++ b/Doc/library/webbrowser.rst
@@ -10,7 +10,7 @@
The :mod:`webbrowser` module provides a high-level interface to allow displaying
Web-based documents to users. Under most circumstances, simply calling the
-:func:`open` function from this module will do the right thing.
+:func:`.open` function from this module will do the right thing.
Under Unix, graphical browsers are preferred under X11, but text-mode browsers
will be used if graphical browsers are not available or an X11 display isn't
@@ -46,14 +46,14 @@ The following exception is defined:
The following functions are defined:
-.. function:: open(url[, new=0[, autoraise=1]])
+.. function:: open(url[, new=0[, autoraise=True]])
- Display *url* using the default browser. If *new* is 0, the *url* is opened in
- the same browser window if possible. If *new* is 1, a new browser window is
- opened if possible. If *new* is 2, a new browser page ("tab") is opened if
- possible. If *autoraise* is true, the window is raised if possible (note that
- under many window managers this will occur regardless of the setting of this
- variable).
+ Display *url* using the default browser. If *new* is 0, the *url* is opened
+ in the same browser window if possible. If *new* is 1, a new browser window
+ is opened if possible. If *new* is 2, a new browser page ("tab") is opened
+ if possible. If *autoraise* is ``True``, the window is raised if possible
+ (note that under many window managers this will occur regardless of the
+ setting of this variable).
Note that on some platforms, trying to open a filename using this function,
may work and start the operating system's associated program. However, this
@@ -175,7 +175,7 @@ Browser controllers provide these methods which parallel three of the
module-level convenience functions:
-.. method:: controller.open(url[, new[, autoraise=1]])
+.. method:: controller.open(url[, new[, autoraise=True]])
Display *url* using the browser handled by this controller. If *new* is 1, a new
browser window is opened if possible. If *new* is 2, a new browser page ("tab")
diff --git a/Doc/library/winreg.rst b/Doc/library/winreg.rst
index f42e7f2..f048067 100644
--- a/Doc/library/winreg.rst
+++ b/Doc/library/winreg.rst
@@ -399,7 +399,7 @@ detached).
The object also support comparison semantics, so handle objects will compare
true if they both reference the same underlying Windows handle value.
-Handle objects can be converted to an integer (e.g., using the builtin
+Handle objects can be converted to an integer (e.g., using the built-in
:func:`int` function), in which case the underlying Windows handle value is
returned. You can also use the :meth:`Detach` method to return the integer
handle, and also disconnect the Windows handle from the handle object.
diff --git a/Doc/library/xml.etree.elementtree.rst b/Doc/library/xml.etree.elementtree.rst
index a04b04a..939af6e 100644
--- a/Doc/library/xml.etree.elementtree.rst
+++ b/Doc/library/xml.etree.elementtree.rst
@@ -262,9 +262,9 @@ The following methods work on the element's children (subelements).
.. method:: Element.getiterator([tag=None])
Creates a tree iterator with the current element as the root. The iterator
- iterates over this element and all elements below it that match the given tag.
- If tag is ``None`` or ``'*'`` then all elements are iterated over. Returns an
- iterable that provides element objects in document (depth first) order.
+ iterates over this element and all elements below it, in document (depth first)
+ order. If *tag* is not ``None`` or ``'*'``, only elements whose tag equals
+ *tag* are returned from the iterator.
.. method:: Element.insert(index, element)
diff --git a/Doc/library/xmlrpc.client.rst b/Doc/library/xmlrpc.client.rst
index 1601430..e004fa7 100644
--- a/Doc/library/xmlrpc.client.rst
+++ b/Doc/library/xmlrpc.client.rst
@@ -87,7 +87,7 @@ between conformable Python objects and XML on the wire.
:exc:`ProtocolError` used to signal an error in the HTTP/HTTPS transport layer.
Both :exc:`Fault` and :exc:`ProtocolError` derive from a base class called
:exc:`Error`. Note that the xmlrpc client module currently does not marshal
- instances of subclasses of builtin types.
+ instances of subclasses of built-in types.
When passing strings, characters special to XML such as ``<``, ``>``, and ``&``
will be automatically escaped. However, it's the caller's responsibility to
diff --git a/Doc/library/zipimport.rst b/Doc/library/zipimport.rst
index 3fd0595..2315823 100644
--- a/Doc/library/zipimport.rst
+++ b/Doc/library/zipimport.rst
@@ -10,7 +10,7 @@
This module adds the ability to import Python modules (:file:`\*.py`,
:file:`\*.py[co]`) and packages from ZIP-format archives. It is usually not
needed to use the :mod:`zipimport` module explicitly; it is automatically used
-by the builtin :keyword:`import` mechanism for ``sys.path`` items that are paths
+by the built-in :keyword:`import` mechanism for ``sys.path`` items that are paths
to ZIP archives.
Typically, ``sys.path`` is a list of directory names as strings. This module