Commit d3342900 authored by Georg Brandl's avatar Georg Brandl

Merged revisions...

Merged revisions 76538,76559,76882-76883,76886,76891-76892,76920,76924-76925,77081,77084,77086,77092 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r76538 | georg.brandl | 2009-11-26 21:48:25 +0100 (Do, 26 Nov 2009) | 1 line

  #7400: typo.
........
  r76559 | georg.brandl | 2009-11-28 12:11:50 +0100 (Sa, 28 Nov 2009) | 1 line

  Fix versions and spacing.
........
  r76882 | georg.brandl | 2009-12-19 18:30:28 +0100 (Sa, 19 Dez 2009) | 1 line

  #7527: use standard versionadded tags.
........
  r76883 | georg.brandl | 2009-12-19 18:34:32 +0100 (Sa, 19 Dez 2009) | 1 line

  #7521: remove Py_GetBuildNumber(), which was removed in favor of Py_GetBuildInfo().
........
  r76886 | georg.brandl | 2009-12-19 18:43:33 +0100 (Sa, 19 Dez 2009) | 1 line

  #7493: review of Design FAQ by Florent Xicluna.
........
  r76891 | georg.brandl | 2009-12-19 19:16:31 +0100 (Sa, 19 Dez 2009) | 1 line

  #7479: add note about function availability on Unices.
........
  r76892 | georg.brandl | 2009-12-19 19:20:18 +0100 (Sa, 19 Dez 2009) | 1 line

  #7480: remove tautology.
........
  r76920 | georg.brandl | 2009-12-20 15:20:16 +0100 (So, 20 Dez 2009) | 1 line

  #7495: backport Programming FAQ review to trunk.
........
  r76924 | georg.brandl | 2009-12-20 15:28:05 +0100 (So, 20 Dez 2009) | 1 line

  Small indentation fix.
........
  r76925 | georg.brandl | 2009-12-20 15:33:20 +0100 (So, 20 Dez 2009) | 1 line

  #7381: subprocess documentation and library docstring consistency fixes.
........
  r77081 | georg.brandl | 2009-12-28 08:59:05 +0100 (Mo, 28 Dez 2009) | 1 line

  #7577: fix signature of PyBuffer_FillInfo().
........
  r77084 | georg.brandl | 2009-12-28 09:01:59 +0100 (Mo, 28 Dez 2009) | 1 line

  #7586: fix typo.
........
  r77086 | georg.brandl | 2009-12-28 09:09:32 +0100 (Mo, 28 Dez 2009) | 1 line

  #7381: consistency update, and backport avoiding ``None >= 0`` check from py3k.
........
  r77092 | georg.brandl | 2009-12-28 09:48:24 +0100 (Mo, 28 Dez 2009) | 1 line

  #7404: remove reference to non-existing example files.
........
parent fd911535
......@@ -293,7 +293,7 @@ Buffer related functions
given shape with the given number of bytes per element.
.. cfunction:: int PyBuffer_FillInfo(Py_buffer *view, void *buf, Py_ssize_t len, int readonly, int infoflags)
.. cfunction:: int PyBuffer_FillInfo(Py_buffer *view, PyObject *obj, void *buf, Py_ssize_t len, int readonly, int infoflags)
Fill in a buffer-info structure, *view*, correctly for an exporter that can
only share a contiguous chunk of memory of "unsigned bytes" of the given
......
......@@ -284,15 +284,6 @@ Initialization, Finalization, and Threads
modify its value. The value is available to Python code as ``sys.version``.
.. cfunction:: const char* Py_GetBuildNumber()
Return a string representing the Subversion revision that this Python executable
was built from. This number is a string because it may contain a trailing 'M'
if Python was built from a mixed revision source tree.
.. versionadded:: 2.5
.. cfunction:: const char* Py_GetPlatform()
.. index:: single: platform (in module sys)
......
This diff is collapsed.
This diff is collapsed.
......@@ -650,7 +650,7 @@ a fixed-width print format:
Point: x= 3.000 y= 4.000 hypot= 5.000
Point: x=14.000 y= 0.714 hypot=14.018
The subclass shown above sets ``__slots__`` to an empty tuple. This keeps
The subclass shown above sets ``__slots__`` to an empty tuple. This helps
keep memory requirements low by preventing the creation of instance dictionaries.
Subclassing is not useful for adding new, stored fields. Instead, simply
......
......@@ -1087,7 +1087,7 @@ available. They are listed here in alphabetical order.
.. function:: set([iterable])
:noindex:
Return a new set, optionally with elements are taken from *iterable*.
Return a new set, optionally with elements taken from *iterable*.
The set type is described in :ref:`types-set`.
For other containers see the built in :class:`dict`, :class:`list`, and
......
......@@ -163,9 +163,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::
......
......@@ -13,18 +13,23 @@ 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.
* 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
* If not separately noted, all functions that claim "Availability: Unix" are
supported on Mac OS X, which builds on a Unix core.
.. note::
......@@ -41,9 +46,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'``, ``'riscos'``.
The name of the operating system dependent module imported. The following
names have currently been registered: ``'posix'``, ``'nt'``, ``'mac'``,
``'os2'``, ``'ce'``, ``'java'``, ``'riscos'``.
.. _os-procinfo:
......
......@@ -2695,8 +2695,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__
......
......@@ -105,7 +105,9 @@ The constants defined in this module are:
String Formatting
-----------------
Starting in Python 2.6, the built-in str and unicode classes provide the ability
.. versionadded:: 2.6
The built-in str and unicode classes provide the ability
to do complex variable substitutions and value formatting via the
:meth:`str.format` method described in :pep:`3101`. The :class:`Formatter`
class in the :mod:`string` module allows you to create and customize your own
......@@ -495,6 +497,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:
......@@ -513,8 +517,6 @@ Instead of the normal ``%``\ -based substitutions, Templates support ``$``\
Any other appearance of ``$`` in the string will result in a :exc:`ValueError`
being raised.
.. versionadded:: 2.4
The :mod:`string` module provides a :class:`Template` class that implements
these rules. The methods of :class:`Template` are:
......
......@@ -151,9 +151,10 @@ This module defines one class called :class:`Popen`:
.. note::
This feature is only available if Python is built with universal newline support
(the default). Also, the newlines attribute of the file objects :attr:`stdout`,
:attr:`stdin` and :attr:`stderr` are not updated by the communicate() method.
This feature is only available if Python is built with universal newline
support (the default). Also, the newlines attribute of the file objects
:attr:`stdout`, :attr:`stdin` and :attr:`stderr` are not updated by the
communicate() method.
The *startupinfo* and *creationflags*, if given, will be passed to the
underlying CreateProcess() function. They can specify things such as appearance
......@@ -187,7 +188,7 @@ This module also defines two shortcut functions:
The arguments are the same as for the Popen constructor. Example::
retcode = call(["ls", "-l"])
>>> retcode = subprocess.call(["ls", "-l"])
.. function:: check_call(*popenargs, **kwargs)
......@@ -199,7 +200,8 @@ This module also defines two shortcut functions:
The arguments are the same as for the Popen constructor. Example::
check_call(["ls", "-l"])
>>> subprocess.check_call(["ls", "-l"])
0
.. versionadded:: 2.5
......
......@@ -447,7 +447,8 @@ _active = []
def _cleanup():
for inst in _active[:]:
if inst._internal_poll(_deadstate=sys.maxint) >= 0:
res = inst._internal_poll(_deadstate=sys.maxint)
if res is not None and res >= 0:
try:
_active.remove(inst)
except ValueError:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment