[Python-3000-checkins] r59221 - in python/branches/py3k/Doc: howto/doanddont.rst library/_winreg.rst library/array.rst library/ctypes.rst library/datetime.rst library/doctest.rst library/functions.rst library/msilib.rst library/optparse.rst library/posix.rst library/random.rst library/sqlite3.rst reference/datamodel.rst

georg.brandl python-3000-checkins at python.org
Thu Nov 29 18:41:06 CET 2007


Author: georg.brandl
Date: Thu Nov 29 18:41:05 2007
New Revision: 59221

Modified:
   python/branches/py3k/Doc/howto/doanddont.rst
   python/branches/py3k/Doc/library/_winreg.rst
   python/branches/py3k/Doc/library/array.rst
   python/branches/py3k/Doc/library/ctypes.rst
   python/branches/py3k/Doc/library/datetime.rst
   python/branches/py3k/Doc/library/doctest.rst
   python/branches/py3k/Doc/library/functions.rst
   python/branches/py3k/Doc/library/msilib.rst
   python/branches/py3k/Doc/library/optparse.rst
   python/branches/py3k/Doc/library/posix.rst
   python/branches/py3k/Doc/library/random.rst
   python/branches/py3k/Doc/library/sqlite3.rst
   python/branches/py3k/Doc/reference/datamodel.rst
Log:
Remove further mentions of long integers.


Modified: python/branches/py3k/Doc/howto/doanddont.rst
==============================================================================
--- python/branches/py3k/Doc/howto/doanddont.rst	(original)
+++ python/branches/py3k/Doc/howto/doanddont.rst	Thu Nov 29 18:41:05 2007
@@ -276,9 +276,9 @@
 line. The :func:`reduce` adds up all the numbers, and the rest is just some
 pre- and postprocessing.
 
-On the same note, note that :func:`float`, :func:`int` and :func:`long` all
-accept arguments of type string, and so are suited to parsing --- assuming you
-are ready to deal with the :exc:`ValueError` they raise.
+On the same note, note that :func:`float` and :func:`int` accept arguments of
+type string, and so are suited to parsing --- assuming you are ready to deal
+with the :exc:`ValueError` they raise.
 
 
 Using Backslash to Continue Statements

Modified: python/branches/py3k/Doc/library/_winreg.rst
==============================================================================
--- python/branches/py3k/Doc/library/_winreg.rst	(original)
+++ python/branches/py3k/Doc/library/_winreg.rst	Thu Nov 29 18:41:05 2007
@@ -408,9 +408,9 @@
 
    Detaches the Windows handle from the handle object.
 
-   The result is an integer (or long on 64 bit Windows) that holds the value of the
-   handle before it is detached.  If the handle is already detached or closed, this
-   will return zero.
+   The result is an integer that holds the value of the handle before it is
+   detached.  If the handle is already detached or closed, this will return
+   zero.
 
    After calling this function, the handle is effectively invalidated, but the
    handle is not closed.  You would call this function when  you need the

Modified: python/branches/py3k/Doc/library/array.rst
==============================================================================
--- python/branches/py3k/Doc/library/array.rst	(original)
+++ python/branches/py3k/Doc/library/array.rst	Thu Nov 29 18:41:05 2007
@@ -32,11 +32,11 @@
 +-----------+----------------+-------------------+-----------------------+
 | ``'i'``   | signed int     | int               | 2                     |
 +-----------+----------------+-------------------+-----------------------+
-| ``'I'``   | unsigned int   | long              | 2                     |
+| ``'I'``   | unsigned int   | int               | 2                     |
 +-----------+----------------+-------------------+-----------------------+
 | ``'l'``   | signed long    | int               | 4                     |
 +-----------+----------------+-------------------+-----------------------+
-| ``'L'``   | unsigned long  | long              | 4                     |
+| ``'L'``   | unsigned long  | int               | 4                     |
 +-----------+----------------+-------------------+-----------------------+
 | ``'f'``   | float          | float             | 4                     |
 +-----------+----------------+-------------------+-----------------------+

Modified: python/branches/py3k/Doc/library/ctypes.rst
==============================================================================
--- python/branches/py3k/Doc/library/ctypes.rst	(original)
+++ python/branches/py3k/Doc/library/ctypes.rst	Thu Nov 29 18:41:05 2007
@@ -197,11 +197,11 @@
 There are, however, enough ways to crash Python with ``ctypes``, so you should
 be careful anyway.
 
-``None``, integers, longs, byte strings and unicode strings are the only native
+``None``, integers, byte strings and unicode strings are the only native
 Python objects that can directly be used as parameters in these function calls.
 ``None`` is passed as a C ``NULL`` pointer, byte strings and unicode strings are
 passed as pointer to the memory block that contains their data (``char *`` or
-``wchar_t *``).  Python integers and Python longs are passed as the platforms
+``wchar_t *``).  Python integers are passed as the platforms
 default C ``int`` type, their value is masked to fit into the C type.
 
 Before we move on calling functions with other parameter types, we have to learn
@@ -222,25 +222,25 @@
    +----------------------+--------------------------------+----------------------------+
    | :class:`c_wchar`     | ``wchar_t``                    | 1-character unicode string |
    +----------------------+--------------------------------+----------------------------+
-   | :class:`c_byte`      | ``char``                       | int/long                   |
+   | :class:`c_byte`      | ``char``                       | int                        |
    +----------------------+--------------------------------+----------------------------+
-   | :class:`c_ubyte`     | ``unsigned char``              | int/long                   |
+   | :class:`c_ubyte`     | ``unsigned char``              | int                        |
    +----------------------+--------------------------------+----------------------------+
-   | :class:`c_short`     | ``short``                      | int/long                   |
+   | :class:`c_short`     | ``short``                      | int                        |
    +----------------------+--------------------------------+----------------------------+
-   | :class:`c_ushort`    | ``unsigned short``             | int/long                   |
+   | :class:`c_ushort`    | ``unsigned short``             | int                        |
    +----------------------+--------------------------------+----------------------------+
-   | :class:`c_int`       | ``int``                        | int/long                   |
+   | :class:`c_int`       | ``int``                        | int                        |
    +----------------------+--------------------------------+----------------------------+
-   | :class:`c_uint`      | ``unsigned int``               | int/long                   |
+   | :class:`c_uint`      | ``unsigned int``               | int                        |
    +----------------------+--------------------------------+----------------------------+
-   | :class:`c_long`      | ``long``                       | int/long                   |
+   | :class:`c_long`      | ``long``                       | int                        |
    +----------------------+--------------------------------+----------------------------+
-   | :class:`c_ulong`     | ``unsigned long``              | int/long                   |
+   | :class:`c_ulong`     | ``unsigned long``              | int                        |
    +----------------------+--------------------------------+----------------------------+
-   | :class:`c_longlong`  | ``__int64`` or ``long long``   | int/long                   |
+   | :class:`c_longlong`  | ``__int64`` or ``long long``   | int                        |
    +----------------------+--------------------------------+----------------------------+
-   | :class:`c_ulonglong` | ``unsigned __int64`` or        | int/long                   |
+   | :class:`c_ulonglong` | ``unsigned __int64`` or        | int                        |
    |                      | ``unsigned long long``         |                            |
    +----------------------+--------------------------------+----------------------------+
    | :class:`c_float`     | ``float``                      | float                      |
@@ -253,7 +253,7 @@
    +----------------------+--------------------------------+----------------------------+
    | :class:`c_wchar_p`   | ``wchar_t *`` (NUL terminated) | unicode or ``None``        |
    +----------------------+--------------------------------+----------------------------+
-   | :class:`c_void_p`    | ``void *``                     | int/long or ``None``       |
+   | :class:`c_void_p`    | ``void *``                     | int or ``None``            |
    +----------------------+--------------------------------+----------------------------+
 
 

Modified: python/branches/py3k/Doc/library/datetime.rst
==============================================================================
--- python/branches/py3k/Doc/library/datetime.rst	(original)
+++ python/branches/py3k/Doc/library/datetime.rst	Thu Nov 29 18:41:05 2007
@@ -132,7 +132,7 @@
 
 .. class:: timedelta([days[, seconds[, microseconds[, milliseconds[, minutes[, hours[, weeks]]]]]]])
 
-   All arguments are optional and default to ``0``.  Arguments may be ints, longs,
+   All arguments are optional and default to ``0``.  Arguments may be integers
    or floats, and may be positive or negative.
 
    Only *days*, *seconds* and *microseconds* are stored internally.  Arguments are
@@ -213,7 +213,7 @@
 |                                | == *t2* - *t3* and *t2* == *t1* + *t3* are    |
 |                                | true. (1)                                     |
 +--------------------------------+-----------------------------------------------+
-| ``t1 = t2 * i or t1 = i * t2`` | Delta multiplied by an integer or long.       |
+| ``t1 = t2 * i or t1 = i * t2`` | Delta multiplied by an integer.               |
 |                                | Afterwards *t1* // i == *t2* is true,         |
 |                                | provided ``i != 0``.                          |
 +--------------------------------+-----------------------------------------------+
@@ -282,7 +282,7 @@
 
 .. class:: date(year, month, day)
 
-   All arguments are required.  Arguments may be ints or longs, in the following
+   All arguments are required.  Arguments may be integers, in the following
    ranges:
 
    * ``MINYEAR <= year <= MAXYEAR``
@@ -503,8 +503,8 @@
 .. class:: datetime(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
 
    The year, month and day arguments are required.  *tzinfo* may be ``None``, or an
-   instance of a :class:`tzinfo` subclass.  The remaining arguments may be ints or
-   longs, in the following ranges:
+   instance of a :class:`tzinfo` subclass.  The remaining arguments may be integers,
+   in the following ranges:
 
    * ``MINYEAR <= year <= MAXYEAR``
    * ``1 <= month <= 12``
@@ -932,7 +932,7 @@
 .. class:: time(hour[, minute[, second[, microsecond[, tzinfo]]]])
 
    All arguments are optional.  *tzinfo* may be ``None``, or an instance of a
-   :class:`tzinfo` subclass.  The remaining arguments may be ints or longs, in the
+   :class:`tzinfo` subclass.  The remaining arguments may be integers, in the
    following ranges:
 
    * ``0 <= hour < 24``

Modified: python/branches/py3k/Doc/library/doctest.rst
==============================================================================
--- python/branches/py3k/Doc/library/doctest.rst	(original)
+++ python/branches/py3k/Doc/library/doctest.rst	Thu Nov 29 18:41:05 2007
@@ -38,17 +38,10 @@
    def factorial(n):
        """Return the factorial of n, an exact integer >= 0.
 
-       If the result is small enough to fit in an int, return an int.
-       Else return a long.
-
        >>> [factorial(n) for n in range(6)]
        [1, 1, 2, 6, 24, 120]
-       >>> [factorial(long(n)) for n in range(6)]
-       [1, 1, 2, 6, 24, 120]
        >>> factorial(30)
-       265252859812191058636308480000000L
-       >>> factorial(30L)
-       265252859812191058636308480000000L
+       265252859812191058636308480000000
        >>> factorial(-1)
        Traceback (most recent call last):
            ...
@@ -60,7 +53,7 @@
            ...
        ValueError: n must be exact integer
        >>> factorial(30.0)
-       265252859812191058636308480000000L
+       265252859812191058636308480000000
 
        It must also not be ridiculously large:
        >>> factorial(1e100)
@@ -109,11 +102,6 @@
    Expecting:
        [1, 1, 2, 6, 24, 120]
    ok
-   Trying:
-       [factorial(long(n)) for n in range(6)]
-   Expecting:
-       [1, 1, 2, 6, 24, 120]
-   ok
 
 And so on, eventually ending with::
 

Modified: python/branches/py3k/Doc/library/functions.rst
==============================================================================
--- python/branches/py3k/Doc/library/functions.rst	(original)
+++ python/branches/py3k/Doc/library/functions.rst	Thu Nov 29 18:41:05 2007
@@ -240,8 +240,8 @@
    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`,
-   :func:`long` and :func:`float`.  If both arguments are omitted, returns ``0j``.
+   the function serves as a numeric conversion function like :func:`int`
+   and :func:`float`.  If both arguments are omitted, returns ``0j``.
 
    The complex type is described in :ref:`typesnumeric`.
 
@@ -319,7 +319,7 @@
 .. function:: divmod(a, b)
 
    Take two (non complex) numbers as arguments and return a pair of numbers
-   consisting of their quotient and remainder when using long division.  With mixed
+   consisting of their quotient and remainder when using integer division.  With mixed
    operand types, the rules for binary arithmetic operators apply.  For integers, 
    the result is the same as ``(a // b, a % b)``. For floating point
    numbers the result is ``(q, a % b)``, where *q* is usually ``math.floor(a / b)``

Modified: python/branches/py3k/Doc/library/msilib.rst
==============================================================================
--- python/branches/py3k/Doc/library/msilib.rst	(original)
+++ python/branches/py3k/Doc/library/msilib.rst	Thu Nov 29 18:41:05 2007
@@ -83,8 +83,7 @@
    containing all fields of a record according to the schema of the table.  For
    optional fields, ``None`` can be passed.
 
-   Field values can be int or long numbers, strings, or instances of the Binary
-   class.
+   Field values can be integers, strings, or instances of the Binary class.
 
 
 .. class:: Binary(filename)

Modified: python/branches/py3k/Doc/library/optparse.rst
==============================================================================
--- python/branches/py3k/Doc/library/optparse.rst	(original)
+++ python/branches/py3k/Doc/library/optparse.rst	Thu Nov 29 18:41:05 2007
@@ -364,7 +364,7 @@
 long option strings, :mod:`optparse` looks at the first short option string: the
 default destination for ``"-f"`` is ``f``.
 
-:mod:`optparse` also includes built-in ``long`` and ``complex`` types.  Adding
+:mod:`optparse` also includes the built-in ``complex`` type.  Adding
 types is covered in section :ref:`optparse-extending-optparse`.
 
 
@@ -1103,14 +1103,14 @@
 Standard option types
 ^^^^^^^^^^^^^^^^^^^^^
 
-:mod:`optparse` has six built-in option types: ``string``, ``int``, ``long``,
+:mod:`optparse` has five built-in option types: ``string``, ``int``,
 ``choice``, ``float`` and ``complex``.  If you need to add new option types, see
 section :ref:`optparse-extending-optparse`.
 
 Arguments to string options are not checked or converted in any way: the text on
 the command line is stored in the destination (or passed to the callback) as-is.
 
-Integer arguments (type ``int`` or ``long``) are parsed as follows:
+Integer arguments (type ``int``) are parsed as follows:
 
 * if the number starts with ``0x``, it is parsed as a hexadecimal number
 
@@ -1121,9 +1121,9 @@
 * otherwise, the number is parsed as a decimal number
 
 
-The conversion is done by calling either ``int()`` or ``long()`` with the
-appropriate base (2, 8, 10, or 16).  If this fails, so will :mod:`optparse`,
-although with a more useful error message.
+The conversion is done by calling ``int()`` with the appropriate base (2, 8, 10,
+or 16).  If this fails, so will :mod:`optparse`, although with a more useful
+error message.
 
 ``float`` and ``complex`` option arguments are converted directly with
 ``float()`` and ``complex()``, with similar error-handling.

Modified: python/branches/py3k/Doc/library/posix.rst
==============================================================================
--- python/branches/py3k/Doc/library/posix.rst	(original)
+++ python/branches/py3k/Doc/library/posix.rst	Thu Nov 29 18:41:05 2007
@@ -51,8 +51,7 @@
 
 Large file support is enabled in Python when the size of an :ctype:`off_t` is
 larger than a :ctype:`long` and the :ctype:`long long` type is available and is
-at least as large as an :ctype:`off_t`. Python longs are then used to represent
-file sizes, offsets and other values that can exceed the range of a Python int.
+at least as large as an :ctype:`off_t`.
 It may be necessary to configure and compile Python with certain compiler flags
 to enable this mode. For example, it is enabled by default with recent versions
 of Irix, but with Solaris 2.6 and 2.7 you need to do something like::

Modified: python/branches/py3k/Doc/library/random.rst
==============================================================================
--- python/branches/py3k/Doc/library/random.rst	(original)
+++ python/branches/py3k/Doc/library/random.rst	Thu Nov 29 18:41:05 2007
@@ -60,8 +60,8 @@
    they are used instead of the system time (see the :func:`os.urandom` function
    for details on availability).
 
-   If *x* is not ``None`` or an int or long, ``hash(x)`` is used instead. If *x* is
-   an int or long, *x* is used directly.
+   If *x* is not ``None`` or an int, ``hash(x)`` is used instead. If *x* is an
+   int, *x* is used directly.
 
 
 .. function:: getstate()
@@ -90,8 +90,8 @@
 
 .. function:: getrandbits(k)
 
-   Returns a python :class:`long` int with *k* random bits. This method is supplied
-   with the MersenneTwister generator and some other generators may also provide it
+   Returns a python integer with *k* random bits. This method is supplied with
+   the MersenneTwister generator and some other generators may also provide it
    as an optional part of the API. When available, :meth:`getrandbits` enables
    :meth:`randrange` to handle arbitrarily large ranges.
 

Modified: python/branches/py3k/Doc/library/sqlite3.rst
==============================================================================
--- python/branches/py3k/Doc/library/sqlite3.rst	(original)
+++ python/branches/py3k/Doc/library/sqlite3.rst	Thu Nov 29 18:41:05 2007
@@ -184,7 +184,7 @@
 
    Registers a callable to convert the custom Python type *type* into one of
    SQLite's supported types. The callable *callable* accepts as single parameter
-   the Python value, and must return a value of the following types: int, long,
+   the Python value, and must return a value of the following types: int,
    float, str (UTF-8 encoded), unicode or buffer.
 
 
@@ -260,7 +260,7 @@
    as the SQL function.
 
    The function can return any of the types supported by SQLite: unicode, str, int,
-   long, float, buffer and None.
+   float, buffer and None.
 
    Example:
 
@@ -276,7 +276,7 @@
    final result of the aggregate.
 
    The ``finalize`` method can return any of the types supported by SQLite:
-   unicode, str, int, long, float, buffer and None.
+   unicode, str, int, float, buffer and None.
 
    Example:
 
@@ -472,8 +472,6 @@
 +------------------------+-------------+
 | ``int``                | INTEGER     |
 +------------------------+-------------+
-| ``long``               | INTEGER     |
-+------------------------+-------------+
 | ``float``              | REAL        |
 +------------------------+-------------+
 | ``str (UTF8-encoded)`` | TEXT        |
@@ -490,7 +488,7 @@
 +=============+=============================================+
 | ``NULL``    | None                                        |
 +-------------+---------------------------------------------+
-| ``INTEGER`` | int or long, depending on size              |
+| ``INTEGER`` | int                                         |
 +-------------+---------------------------------------------+
 | ``REAL``    | float                                       |
 +-------------+---------------------------------------------+
@@ -510,7 +508,7 @@
 
 As described before, SQLite supports only a limited set of types natively. To
 use other Python types with SQLite, you must **adapt** them to one of the
-sqlite3 module's supported types for SQLite: one of NoneType, int, long, float,
+sqlite3 module's supported types for SQLite: one of NoneType, int, float,
 str, unicode, buffer.
 
 The :mod:`sqlite3` module uses Python object adaptation, as described in

Modified: python/branches/py3k/Doc/reference/datamodel.rst
==============================================================================
--- python/branches/py3k/Doc/reference/datamodel.rst	(original)
+++ python/branches/py3k/Doc/reference/datamodel.rst	Thu Nov 29 18:41:05 2007
@@ -1490,7 +1490,7 @@
   *__slots__*.
 
 * *__slots__* do not work for classes derived from "variable-length" built-in
-  types such as :class:`long`, :class:`str` and :class:`tuple`.
+  types such as :class:`int`, :class:`str` and :class:`tuple`.
 
 * Any non-string iterable may be assigned to *__slots__*. Mappings may also be
   used; however, in the future, special meaning may be assigned to the values
@@ -1808,24 +1808,22 @@
 
 .. method:: object.__complex__(self)
             object.__int__(self)
-            object.__long__(self)
             object.__float__(self)
 
    .. index::
       builtin: complex
       builtin: int
-      builtin: long
       builtin: float
 
-   Called to implement the built-in functions :func:`complex`, :func:`int`,
-   :func:`long`, and :func:`float`.  Should return a value of the appropriate type.
+   Called to implement the built-in functions :func:`complex`, :func:`int`
+   and :func:`float`.  Should return a value of the appropriate type.
 
 
 .. method:: object.__index__(self)
 
    Called to implement :func:`operator.index`.  Also called whenever Python needs
    an integer object (such as in slicing, or in the built-in :func:`bin`,
-   :func:`hex` and :func:`oct` functions). Must return an integer (int or long).
+   :func:`hex` and :func:`oct` functions). Must return an integer.
 
 
 .. _context-managers:


More information about the Python-3000-checkins mailing list