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.
........
This commit is contained in:
Alexandre Vassalotti 2009-07-29 19:54:39 +00:00
parent fc230e8cfa
commit 6d3dfc3ff2
19 changed files with 167 additions and 149 deletions

View file

@ -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:

View file

@ -194,7 +194,7 @@ class can also install themselves in the built-in namespace as 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:`_`

View file

@ -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)

View file

@ -120,7 +120,17 @@ Notes:
Comparisons
===========
.. index:: pair: chaining; comparisons
.. index::
pair: chaining; comparisons
pair: operator; comparison
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
@ -128,17 +138,6 @@ 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: operator; comparison
operator: ==
operator: <
operator: >
operator: <=
operator: >=
operator: !=
operator: is
operator: is not
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)

View file

@ -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

View file

@ -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")

View file

@ -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)