summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-12-31 03:11:23 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-12-31 03:11:23 (GMT)
commit1baf465d272bbe9378bd3dbf209ebdb445042726 (patch)
treed0d47ec2e80d4051487be886ef6a17812a16ce46 /Doc
parent2591d21deb32b180768918f613a4286ddbf100a0 (diff)
downloadcpython-1baf465d272bbe9378bd3dbf209ebdb445042726.zip
cpython-1baf465d272bbe9378bd3dbf209ebdb445042726.tar.gz
cpython-1baf465d272bbe9378bd3dbf209ebdb445042726.tar.bz2
Merged revisions 76847,76851,76869,76882,76891-76892,76924,77007,77070,77092,77096,77120,77126,77155 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76847 | benjamin.peterson | 2009-12-14 21:25:27 -0600 (Mon, 14 Dec 2009) | 1 line adverb ........ r76851 | benjamin.peterson | 2009-12-15 21:28:52 -0600 (Tue, 15 Dec 2009) | 1 line remove lib2to3 resource ........ r76869 | vinay.sajip | 2009-12-17 08:52:00 -0600 (Thu, 17 Dec 2009) | 1 line Issue #7529: logging: Minor correction to documentation. ........ r76882 | georg.brandl | 2009-12-19 11:30:28 -0600 (Sat, 19 Dec 2009) | 1 line #7527: use standard versionadded tags. ........ r76891 | georg.brandl | 2009-12-19 12:16:31 -0600 (Sat, 19 Dec 2009) | 1 line #7479: add note about function availability on Unices. ........ r76892 | georg.brandl | 2009-12-19 12:20:18 -0600 (Sat, 19 Dec 2009) | 1 line #7480: remove tautology. ........ r76924 | georg.brandl | 2009-12-20 08:28:05 -0600 (Sun, 20 Dec 2009) | 1 line Small indentation fix. ........ r77007 | gregory.p.smith | 2009-12-23 03:31:11 -0600 (Wed, 23 Dec 2009) | 3 lines Fix possible integer overflow in lchown and fchown functions. For issue1747858. ........ r77070 | amaury.forgeotdarc | 2009-12-27 14:06:44 -0600 (Sun, 27 Dec 2009) | 2 lines Fix a typo in comment ........ r77092 | georg.brandl | 2009-12-28 02:48:24 -0600 (Mon, 28 Dec 2009) | 1 line #7404: remove reference to non-existing example files. ........ r77096 | benjamin.peterson | 2009-12-28 14:51:17 -0600 (Mon, 28 Dec 2009) | 1 line document new fix_callable behavior ........ r77120 | georg.brandl | 2009-12-29 15:09:17 -0600 (Tue, 29 Dec 2009) | 1 line #7595: fix typo in argument default constant. ........ r77126 | amaury.forgeotdarc | 2009-12-29 17:06:17 -0600 (Tue, 29 Dec 2009) | 2 lines #7579: Add docstrings to the msvcrt module ........ r77155 | georg.brandl | 2009-12-30 13:03:00 -0600 (Wed, 30 Dec 2009) | 1 line We only support Windows NT derivatives now. ........
Diffstat (limited to 'Doc')
-rw-r--r--Doc/faq/design.rst2
-rw-r--r--Doc/library/2to3.rst3
-rw-r--r--Doc/library/ctypes.rst2
-rw-r--r--Doc/library/logging.rst2
-rw-r--r--Doc/library/msvcrt.rst4
-rw-r--r--Doc/library/optparse.rst4
-rw-r--r--Doc/library/os.rst36
-rw-r--r--Doc/library/select.rst2
-rw-r--r--Doc/library/stdtypes.rst3
-rw-r--r--Doc/library/string.rst3
10 files changed, 35 insertions, 26 deletions
diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst
index 6571cc2..b6a0e17 100644
--- a/Doc/faq/design.rst
+++ b/Doc/faq/design.rst
@@ -810,7 +810,7 @@ on the entrance and exit from the block. Some language have a construct that
looks like this::
with obj:
- a = 1 # equivalent to obj.a = 1
+ a = 1 # equivalent to obj.a = 1
total = total + 1 # obj.total = obj.total + 1
In Python, such a construct would be ambiguous.
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst
index d9eb00c..20a6245 100644
--- a/Doc/library/2to3.rst
+++ b/Doc/library/2to3.rst
@@ -122,7 +122,8 @@ and off individually. They are described here in more detail.
.. 2to3fixer:: callable
- Converts ``callable(x)`` to ``hasattr(x, "__call_")``.
+ Converts ``callable(x)`` to ``isinstance(x, collections.Callable)``, adding
+ an import to :mod:`collections` if needed.
.. 2to3fixer:: dict
diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst
index 4f632f2..652a2f4 100644
--- a/Doc/library/ctypes.rst
+++ b/Doc/library/ctypes.rst
@@ -1005,7 +1005,7 @@ Here is what we get on Windows::
>>>
It is funny to see that on linux the sort function seems to work much more
-efficient, it is doing less comparisons::
+efficiently, it is doing less comparisons::
>>> qsort(ia, len(ia), sizeof(c_int), cmp_func) # doctest: +LINUX
py_cmp_func 5 1
diff --git a/Doc/library/logging.rst b/Doc/library/logging.rst
index b05282b..a576838 100644
--- a/Doc/library/logging.rst
+++ b/Doc/library/logging.rst
@@ -1659,6 +1659,8 @@ file-like object (or, more precisely, any object which supports :meth:`write`
and :meth:`flush` methods).
+.. currentmodule:: logging
+
.. class:: StreamHandler(stream=None)
Returns a new instance of the :class:`StreamHandler` class. If *stream* is
diff --git a/Doc/library/msvcrt.rst b/Doc/library/msvcrt.rst
index 2b31180..d968833 100644
--- a/Doc/library/msvcrt.rst
+++ b/Doc/library/msvcrt.rst
@@ -144,6 +144,4 @@ Other Functions
.. function:: heapmin()
Force the :cfunc:`malloc` heap to clean itself up and return unused blocks to
- the operating system. This only works on Windows NT. On failure, this raises
- :exc:`IOError`.
-
+ the operating system. On failure, this raises :exc:`IOError`.
diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst
index 523079f..9527d35 100644
--- a/Doc/library/optparse.rst
+++ b/Doc/library/optparse.rst
@@ -153,9 +153,7 @@ required option
an option that must be supplied on the command-line; note that the phrase
"required option" is self-contradictory in English. :mod:`optparse` doesn't
prevent you from implementing required options, but doesn't give you much
- help at it either. See ``examples/required_1.py`` and
- ``examples/required_2.py`` in the :mod:`optparse` source distribution for two
- ways to implement required options with :mod:`optparse`.
+ help at it either.
For example, consider this hypothetical command-line::
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index 7c96bfe..96d2184 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -13,26 +13,34 @@ module. For creating temporary files and directories see the :mod:`tempfile`
module, and for high-level file and directory handling see the :mod:`shutil`
module.
-The design of all built-in operating system dependent modules of Python is such
-that as long as the same functionality is available, it uses the same interface;
-for example, the function ``os.stat(path)`` returns stat information about
-*path* in the same format (which happens to have originated with the POSIX
-interface).
+Notes on the availability of these functions:
-Extensions peculiar to a particular operating system are also available through
-the :mod:`os` module, but using them is of course a threat to portability!
+* The design of all built-in operating system dependent modules of Python is
+ such that as long as the same functionality is available, it uses the same
+ interface; for example, the function ``os.stat(path)`` returns stat
+ information about *path* in the same format (which happens to have originated
+ with the POSIX interface).
-.. note::
+* Extensions peculiar to a particular operating system are also available
+ through the :mod:`os` module, but using them is of course a threat to
+ portability.
- All functions accepting path or file names accept both bytes and string
- objects, and result in an object of the same type, if a path or file name is
- returned.
+* All functions accepting path or file names accept both bytes and string
+ objects, and result in an object of the same type, if a path or file name is
+ returned.
.. note::
If not separately noted, all functions that claim "Availability: Unix" are
supported on Mac OS X, which builds on a Unix core.
+* An "Availability: Unix" note means that this function is commonly found on
+ Unix systems. It does not make any claims about its existence on a specific
+ operating system.
+
+* If not separately noted, all functions that claim "Availability: Unix" are
+ supported on Mac OS X, which builds on a Unix core.
+
.. note::
All functions in this module raise :exc:`OSError` in the case of invalid or
@@ -46,9 +54,9 @@ the :mod:`os` module, but using them is of course a threat to portability!
.. data:: name
- The name of the operating system dependent module imported. The following names
- have currently been registered: ``'posix'``, ``'nt'``, ``'mac'``, ``'os2'``,
- ``'ce'``, ``'java'``.
+ The name of the operating system dependent module imported. The following
+ names have currently been registered: ``'posix'``, ``'nt'``, ``'mac'``,
+ ``'os2'``, ``'ce'``, ``'java'``.
.. _os-filenames:
diff --git a/Doc/library/select.rst b/Doc/library/select.rst
index ae5ffa5..60a894f 100644
--- a/Doc/library/select.rst
+++ b/Doc/library/select.rst
@@ -45,7 +45,7 @@ The module defines the following:
:ref:`kqueue-objects` below for the methods supported by kqueue objects.
-.. function:: kevent(ident, filter=KQ_FILTER_READ, flags=KQ_ADD, fflags=0, data=0, udata=0)
+.. function:: kevent(ident, filter=KQ_FILTER_READ, flags=KQ_EV_ADD, fflags=0, data=0, udata=0)
(Only supported on BSD.) Returns a kernel event object object; see section
:ref:`kevent-objects` below for the methods supported by kqueue objects.
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index eaa413b..469ecdd 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -2458,8 +2458,7 @@ types, where they are relevant. Some of these are not reported by the
.. attribute:: class.__bases__
- The tuple of base classes of a class object. If there are no base classes, this
- will be an empty tuple.
+ The tuple of base classes of a class object.
.. attribute:: class.__name__
diff --git a/Doc/library/string.rst b/Doc/library/string.rst
index 0766894..d181841 100644
--- a/Doc/library/string.rst
+++ b/Doc/library/string.rst
@@ -86,6 +86,7 @@ substitutions and value formatting via the :func:`format` method described in
you to create and customize your own string formatting behaviors using the same
implementation as the built-in :meth:`format` method.
+
.. class:: Formatter
The :class:`Formatter` class has the following public methods:
@@ -470,6 +471,8 @@ The available presentation types for floating point and decimal values are:
Template strings
----------------
+.. versionadded:: 2.4
+
Templates provide simpler string substitutions as described in :pep:`292`.
Instead of the normal ``%``\ -based substitutions, Templates support ``$``\
-based substitutions, using the following rules: