[Python-checkins] cpython (merge 3.4 -> default): merge with 3.4

georg.brandl python-checkins at python.org
Mon Oct 6 13:55:05 CEST 2014


https://hg.python.org/cpython/rev/de49b52059cc
changeset:   92840:de49b52059cc
parent:      92838:e96a738cd0df
parent:      92839:aafc0d0a18a2
user:        Georg Brandl <georg at python.org>
date:        Mon Oct 06 13:54:43 2014 +0200
summary:
  merge with 3.4

files:
  Doc/library/functions.rst |  82 +++++++++++++-------------
  1 files changed, 41 insertions(+), 41 deletions(-)


diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -85,22 +85,22 @@
    :meth:`__index__` method that returns an integer.
 
 
-.. function:: bool([x])
+.. class:: bool([x])
 
-   Convert a value to a Boolean, using the standard :ref:`truth testing
-   procedure <truth>`.  If *x* is false or omitted, this returns ``False``;
-   otherwise it returns ``True``. :class:`bool` is also a class, which is a
-   subclass of :class:`int` (see :ref:`typesnumeric`).  Class :class:`bool`
-   cannot be subclassed further.  Its only instances are ``False`` and
+   Return a Boolean value, i.e. one of ``True`` or ``False``.  *x* is converted
+   using the standard :ref:`truth testing procedure <truth>`.  If *x* is false
+   or omitted, this returns ``False``; otherwise it returns ``True``.  The
+   :class:`bool` class is a subclass of :class:`int` (see :ref:`typesnumeric`).
+   It cannot be subclassed further.  Its only instances are ``False`` and
    ``True`` (see :ref:`bltin-boolean-values`).
 
    .. index:: pair: Boolean; type
 
 
 .. _func-bytearray:
-.. function:: bytearray([source[, encoding[, errors]]])
+.. class:: bytearray([source[, encoding[, errors]]])
 
-   Return a new array of bytes.  The :class:`bytearray` type is a mutable
+   Return a new array of bytes.  The :class:`bytearray` class is a mutable
    sequence of integers in the range 0 <= x < 256.  It has most of the usual
    methods of mutable sequences, described in :ref:`typesseq-mutable`, as well
    as most methods that the :class:`bytes` type has, see :ref:`bytes-methods`.
@@ -127,7 +127,7 @@
 
 
 .. _func-bytes:
-.. function:: bytes([source[, encoding[, errors]]])
+.. class:: bytes([source[, encoding[, errors]]])
 
    Return a new "bytes" object, which is an immutable sequence of integers in
    the range ``0 <= x < 256``.  :class:`bytes` is an immutable version of
@@ -244,15 +244,16 @@
       does not have to end in a newline anymore.  Added the *optimize* parameter.
 
 
-.. function:: complex([real[, imag]])
+.. class:: complex([real[, imag]])
 
-   Create a complex number with the value *real* + *imag*\*j or convert a string or
-   number to a complex number.  If the first parameter is a string, it will be
-   interpreted as a complex number and the function must be called without a second
-   parameter.  The second parameter can never be a string. Each argument may be any
-   numeric type (including complex). If *imag* is omitted, it defaults to zero and
-   the function serves as a numeric conversion function like :func:`int`
-   and :func:`float`.  If both arguments are omitted, returns ``0j``.
+   Return a complex number with the value *real* + *imag*\*j or convert a string
+   or number to a complex number.  If the first parameter is a string, it will
+   be interpreted as a complex number and the function must be called without a
+   second parameter.  The second parameter can never be a string. Each argument
+   may be any numeric type (including complex).  If *imag* is omitted, it
+   defaults to zero and the constructor serves as a numeric conversion like
+   :class:`int` and :class:`float`.  If both arguments are omitted, returns
+   ``0j``.
 
    .. note::
 
@@ -273,14 +274,13 @@
 
 
 .. _func-dict:
-.. function:: dict(**kwarg)
-              dict(mapping, **kwarg)
-              dict(iterable, **kwarg)
+.. class:: dict(**kwarg)
+           dict(mapping, **kwarg)
+           dict(iterable, **kwarg)
    :noindex:
 
    Create a new dictionary.  The :class:`dict` object is the dictionary class.
-   See :class:`dict` and :ref:`typesmapping` for documentation about this
-   class.
+   See :class:`dict` and :ref:`typesmapping` for documentation about this class.
 
    For other containers see the built-in :class:`list`, :class:`set`, and
    :class:`tuple` classes, as well as the :mod:`collections` module.
@@ -471,13 +471,13 @@
    elements of *iterable* for which *function* returns false.
 
 
-.. function:: float([x])
+.. class:: float([x])
 
    .. index::
       single: NaN
       single: Infinity
 
-   Convert a string or a number to floating point.
+   Return a floating point number constructed from a number or string *x*.
 
    If the argument is a string, it should contain a decimal number, optionally
    preceded by a sign, and optionally embedded in whitespace.  The optional
@@ -552,7 +552,7 @@
 
 
 .. _func-frozenset:
-.. function:: frozenset([iterable])
+.. class:: frozenset([iterable])
    :noindex:
 
    Return a new :class:`frozenset` object, optionally with elements taken from
@@ -665,12 +665,13 @@
    to provide elaborate line editing and history features.
 
 
-.. function:: int(x=0)
-              int(x, base=10)
+.. class:: int(x=0)
+           int(x, base=10)
 
-   Convert a number or string *x* to an integer, or return ``0`` if no
-   arguments are given.  If *x* is a number, return :meth:`x.__int__()
-   <object.__int__>`.  For floating point numbers, this truncates towards zero.
+   Return an integer object constructed from a number or string *x*, or return
+   ``0`` if no arguments are given.  If *x* is a number, return
+   :meth:`x.__int__() <object.__int__>`.  For floating point numbers, this
+   truncates towards zero.
 
    If *x* is not a number or if *base* is given, then *x* must be a string,
    :class:`bytes`, or :class:`bytearray` instance representing an :ref:`integer
@@ -749,7 +750,7 @@
 
 
 .. _func-list:
-.. function:: list([iterable])
+.. class:: list([iterable])
    :noindex:
 
    Rather than being a function, :class:`list` is actually a mutable
@@ -843,7 +844,7 @@
    if the iterator is exhausted, otherwise :exc:`StopIteration` is raised.
 
 
-.. function:: object()
+.. class:: object()
 
    Return a new featureless object.  :class:`object` is a base for all classes.
    It has the methods that are common to all instances of Python classes.  This
@@ -1105,7 +1106,7 @@
       Added the *flush* keyword argument.
 
 
-.. function:: property(fget=None, fset=None, fdel=None, doc=None)
+.. class:: property(fget=None, fset=None, fdel=None, doc=None)
 
    Return a property attribute.
 
@@ -1231,7 +1232,7 @@
 
 
 .. _func-set:
-.. function:: set([iterable])
+.. class:: set([iterable])
    :noindex:
 
    Return a new :class:`set` object, optionally with elements taken from
@@ -1252,8 +1253,8 @@
    ``x.foobar = 123``.
 
 
-.. function:: slice(stop)
-              slice(start, stop[, step])
+.. class:: slice(stop)
+           slice(start, stop[, step])
 
    .. index:: single: Numerical Python
 
@@ -1316,8 +1317,8 @@
 
 
 .. _func-str:
-.. function:: str(object='')
-              str(object=b'', encoding='utf-8', errors='strict')
+.. class:: str(object='')
+           str(object=b'', encoding='utf-8', errors='strict')
    :noindex:
 
    Return a :class:`str` version of *object*.  See :func:`str` for details.
@@ -1404,12 +1405,11 @@
    sequence type, as documented in :ref:`typesseq-tuple` and :ref:`typesseq`.
 
 
-.. function:: type(object)
-              type(name, bases, dict)
+.. class:: type(object)
+           type(name, bases, dict)
 
    .. index:: object: type
 
-
    With one argument, return the type of an *object*.  The return value is a
    type object and generally the same object as returned by
    :attr:`object.__class__ <instance.__class__>`.

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list