diff options
Diffstat (limited to 'Doc/library')
-rw-r--r-- | Doc/library/2to3.rst | 7 | ||||
-rw-r--r-- | Doc/library/gettext.rst | 2 | ||||
-rw-r--r-- | Doc/library/socket.rst | 2 | ||||
-rw-r--r-- | Doc/library/stdtypes.rst | 40 | ||||
-rw-r--r-- | Doc/library/warnings.rst | 2 | ||||
-rw-r--r-- | Doc/library/webbrowser.rst | 16 | ||||
-rw-r--r-- | Doc/library/xml.etree.elementtree.rst | 6 |
7 files changed, 39 insertions, 36 deletions
diff --git a/Doc/library/2to3.rst b/Doc/library/2to3.rst index 29ab066..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: diff --git a/Doc/library/gettext.rst b/Doc/library/gettext.rst index a29d953..eba59c8 100644 --- a/Doc/library/gettext.rst +++ b/Doc/library/gettext.rst @@ -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:`_` 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/stdtypes.rst b/Doc/library/stdtypes.rst index 04d0b5d..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) 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/webbrowser.rst b/Doc/library/webbrowser.rst index 86a9043..01720d1 100644 --- a/Doc/library/webbrowser.rst +++ b/Doc/library/webbrowser.rst @@ -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/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) |