diff options
author | Georg Brandl <georg@python.org> | 2007-11-29 17:41:05 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-11-29 17:41:05 (GMT) |
commit | 5c10664043448f1d27d7ce7eb67c2afe3f54b018 (patch) | |
tree | a5b3ada6978c46dc179e97011c02031bb4e9344e | |
parent | ba956aebb96c38f1b8818189ed6ab18d5441313a (diff) | |
download | cpython-5c10664043448f1d27d7ce7eb67c2afe3f54b018.zip cpython-5c10664043448f1d27d7ce7eb67c2afe3f54b018.tar.gz cpython-5c10664043448f1d27d7ce7eb67c2afe3f54b018.tar.bz2 |
Remove further mentions of long integers.
-rw-r--r-- | Doc/howto/doanddont.rst | 6 | ||||
-rw-r--r-- | Doc/library/_winreg.rst | 6 | ||||
-rw-r--r-- | Doc/library/array.rst | 4 | ||||
-rw-r--r-- | Doc/library/ctypes.rst | 26 | ||||
-rw-r--r-- | Doc/library/datetime.rst | 12 | ||||
-rw-r--r-- | Doc/library/doctest.rst | 16 | ||||
-rw-r--r-- | Doc/library/functions.rst | 6 | ||||
-rw-r--r-- | Doc/library/msilib.rst | 3 | ||||
-rw-r--r-- | Doc/library/optparse.rst | 12 | ||||
-rw-r--r-- | Doc/library/posix.rst | 3 | ||||
-rw-r--r-- | Doc/library/random.rst | 8 | ||||
-rw-r--r-- | Doc/library/sqlite3.rst | 12 | ||||
-rw-r--r-- | Doc/reference/datamodel.rst | 10 |
13 files changed, 53 insertions, 71 deletions
diff --git a/Doc/howto/doanddont.rst b/Doc/howto/doanddont.rst index 07652bc..ace5bed 100644 --- a/Doc/howto/doanddont.rst +++ b/Doc/howto/doanddont.rst @@ -276,9 +276,9 @@ This cute little script prints the average of all numbers given on the command 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 diff --git a/Doc/library/_winreg.rst b/Doc/library/_winreg.rst index 1a384fe..a3fe72b 100644 --- a/Doc/library/_winreg.rst +++ b/Doc/library/_winreg.rst @@ -408,9 +408,9 @@ handle, and also disconnect the Windows handle from the handle object. 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 diff --git a/Doc/library/array.rst b/Doc/library/array.rst index e86d0cc..ec68f65 100644 --- a/Doc/library/array.rst +++ b/Doc/library/array.rst @@ -32,11 +32,11 @@ defined: +-----------+----------------+-------------------+-----------------------+ | ``'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 | +-----------+----------------+-------------------+-----------------------+ diff --git a/Doc/library/ctypes.rst b/Doc/library/ctypes.rst index 7f3f875..c759832 100644 --- a/Doc/library/ctypes.rst +++ b/Doc/library/ctypes.rst @@ -197,11 +197,11 @@ argument values:: 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 @@ Fundamental data types +----------------------+--------------------------------+----------------------------+ | :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 @@ Fundamental data types +----------------------+--------------------------------+----------------------------+ | :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`` | +----------------------+--------------------------------+----------------------------+ diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst index e67c9eb..87a9bbd 100644 --- a/Doc/library/datetime.rst +++ b/Doc/library/datetime.rst @@ -132,7 +132,7 @@ dates or times. .. 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 @@ Supported operations: | | == *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 @@ systems. .. 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 @@ Constructor: .. 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 @@ day, and subject to adjustment via a :class:`tzinfo` object. .. 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`` diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst index df1f6e3..721d7c0 100644 --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst @@ -38,17 +38,10 @@ Here's a complete but small example module:: 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 @@ Here's a complete but small example module:: ... ValueError: n must be exact integer >>> factorial(30.0) - 265252859812191058636308480000000L + 265252859812191058636308480000000 It must also not be ridiculously large: >>> factorial(1e100) @@ -109,11 +102,6 @@ it's trying, and prints a summary at the end:: 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:: diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 4236253..68601e5 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -240,8 +240,8 @@ available. They are listed here in alphabetical order. 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 @@ available. They are listed here in alphabetical order. .. 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)`` diff --git a/Doc/library/msilib.rst b/Doc/library/msilib.rst index c361a29..1c50d82 100644 --- a/Doc/library/msilib.rst +++ b/Doc/library/msilib.rst @@ -83,8 +83,7 @@ structures. 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) diff --git a/Doc/library/optparse.rst b/Doc/library/optparse.rst index 4c0f0da..f5488e7 100644 --- a/Doc/library/optparse.rst +++ b/Doc/library/optparse.rst @@ -364,7 +364,7 @@ default from the option strings: if the first long option string is 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 @@ to a particular option, or fail to pass a required option attribute, 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 @@ Integer arguments (type ``int`` or ``long``) are parsed as follows: * 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. diff --git a/Doc/library/posix.rst b/Doc/library/posix.rst index 2074e45..a845e35 100644 --- a/Doc/library/posix.rst +++ b/Doc/library/posix.rst @@ -51,8 +51,7 @@ sometimes referred to as :dfn:`large files`. 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:: diff --git a/Doc/library/random.rst b/Doc/library/random.rst index 9b02003..0062ffe 100644 --- a/Doc/library/random.rst +++ b/Doc/library/random.rst @@ -60,8 +60,8 @@ Bookkeeping functions: 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 @@ Bookkeeping functions: .. 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. diff --git a/Doc/library/sqlite3.rst b/Doc/library/sqlite3.rst index eddf470..0b569bf 100644 --- a/Doc/library/sqlite3.rst +++ b/Doc/library/sqlite3.rst @@ -184,7 +184,7 @@ Module functions and constants 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 @@ A :class:`Connection` instance has the following attributes and methods: 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 @@ A :class:`Connection` instance has the following attributes and methods: 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 @@ The following Python types can thus be sent to SQLite without any problem: +------------------------+-------------+ | ``int`` | INTEGER | +------------------------+-------------+ -| ``long`` | INTEGER | -+------------------------+-------------+ | ``float`` | REAL | +------------------------+-------------+ | ``str (UTF8-encoded)`` | TEXT | @@ -490,7 +488,7 @@ This is how SQLite types are converted to Python types by default: +=============+=============================================+ | ``NULL`` | None | +-------------+---------------------------------------------+ -| ``INTEGER`` | int or long, depending on size | +| ``INTEGER`` | int | +-------------+---------------------------------------------+ | ``REAL`` | float | +-------------+---------------------------------------------+ @@ -510,7 +508,7 @@ Using adapters to store additional Python types in SQLite databases 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 diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index f33df0b..49bc8b6 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1490,7 +1490,7 @@ Notes on using *__slots__* *__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 @@ left undefined. .. 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: |