Skip to content

Commit 5c10664

Browse files
committed
Remove further mentions of long integers.
1 parent ba956ae commit 5c10664

File tree

13 files changed

+53
-71
lines changed

13 files changed

+53
-71
lines changed

Doc/howto/doanddont.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,9 @@ This cute little script prints the average of all numbers given on the command
276276
line. The :func:`reduce` adds up all the numbers, and the rest is just some
277277
pre- and postprocessing.
278278

279-
On the same note, note that :func:`float`, :func:`int` and :func:`long` all
280-
accept arguments of type string, and so are suited to parsing --- assuming you
281-
are ready to deal with the :exc:`ValueError` they raise.
279+
On the same note, note that :func:`float` and :func:`int` accept arguments of
280+
type string, and so are suited to parsing --- assuming you are ready to deal
281+
with the :exc:`ValueError` they raise.
282282

283283

284284
Using Backslash to Continue Statements

Doc/library/_winreg.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,9 @@ handle, and also disconnect the Windows handle from the handle object.
408408

409409
Detaches the Windows handle from the handle object.
410410

411-
The result is an integer (or long on 64 bit Windows) that holds the value of the
412-
handle before it is detached. If the handle is already detached or closed, this
413-
will return zero.
411+
The result is an integer that holds the value of the handle before it is
412+
detached. If the handle is already detached or closed, this will return
413+
zero.
414414

415415
After calling this function, the handle is effectively invalidated, but the
416416
handle is not closed. You would call this function when you need the

Doc/library/array.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ defined:
3232
+-----------+----------------+-------------------+-----------------------+
3333
| ``'i'`` | signed int | int | 2 |
3434
+-----------+----------------+-------------------+-----------------------+
35-
| ``'I'`` | unsigned int | long | 2 |
35+
| ``'I'`` | unsigned int | int | 2 |
3636
+-----------+----------------+-------------------+-----------------------+
3737
| ``'l'`` | signed long | int | 4 |
3838
+-----------+----------------+-------------------+-----------------------+
39-
| ``'L'`` | unsigned long | long | 4 |
39+
| ``'L'`` | unsigned long | int | 4 |
4040
+-----------+----------------+-------------------+-----------------------+
4141
| ``'f'`` | float | float | 4 |
4242
+-----------+----------------+-------------------+-----------------------+

Doc/library/ctypes.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,11 @@ argument values::
197197
There are, however, enough ways to crash Python with ``ctypes``, so you should
198198
be careful anyway.
199199

200-
``None``, integers, longs, byte strings and unicode strings are the only native
200+
``None``, integers, byte strings and unicode strings are the only native
201201
Python objects that can directly be used as parameters in these function calls.
202202
``None`` is passed as a C ``NULL`` pointer, byte strings and unicode strings are
203203
passed as pointer to the memory block that contains their data (``char *`` or
204-
``wchar_t *``). Python integers and Python longs are passed as the platforms
204+
``wchar_t *``). Python integers are passed as the platforms
205205
default C ``int`` type, their value is masked to fit into the C type.
206206

207207
Before we move on calling functions with other parameter types, we have to learn
@@ -222,25 +222,25 @@ Fundamental data types
222222
+----------------------+--------------------------------+----------------------------+
223223
| :class:`c_wchar` | ``wchar_t`` | 1-character unicode string |
224224
+----------------------+--------------------------------+----------------------------+
225-
| :class:`c_byte` | ``char`` | int/long |
225+
| :class:`c_byte` | ``char`` | int |
226226
+----------------------+--------------------------------+----------------------------+
227-
| :class:`c_ubyte` | ``unsigned char`` | int/long |
227+
| :class:`c_ubyte` | ``unsigned char`` | int |
228228
+----------------------+--------------------------------+----------------------------+
229-
| :class:`c_short` | ``short`` | int/long |
229+
| :class:`c_short` | ``short`` | int |
230230
+----------------------+--------------------------------+----------------------------+
231-
| :class:`c_ushort` | ``unsigned short`` | int/long |
231+
| :class:`c_ushort` | ``unsigned short`` | int |
232232
+----------------------+--------------------------------+----------------------------+
233-
| :class:`c_int` | ``int`` | int/long |
233+
| :class:`c_int` | ``int`` | int |
234234
+----------------------+--------------------------------+----------------------------+
235-
| :class:`c_uint` | ``unsigned int`` | int/long |
235+
| :class:`c_uint` | ``unsigned int`` | int |
236236
+----------------------+--------------------------------+----------------------------+
237-
| :class:`c_long` | ``long`` | int/long |
237+
| :class:`c_long` | ``long`` | int |
238238
+----------------------+--------------------------------+----------------------------+
239-
| :class:`c_ulong` | ``unsigned long`` | int/long |
239+
| :class:`c_ulong` | ``unsigned long`` | int |
240240
+----------------------+--------------------------------+----------------------------+
241-
| :class:`c_longlong` | ``__int64`` or ``long long`` | int/long |
241+
| :class:`c_longlong` | ``__int64`` or ``long long`` | int |
242242
+----------------------+--------------------------------+----------------------------+
243-
| :class:`c_ulonglong` | ``unsigned __int64`` or | int/long |
243+
| :class:`c_ulonglong` | ``unsigned __int64`` or | int |
244244
| | ``unsigned long long`` | |
245245
+----------------------+--------------------------------+----------------------------+
246246
| :class:`c_float` | ``float`` | float |
@@ -253,7 +253,7 @@ Fundamental data types
253253
+----------------------+--------------------------------+----------------------------+
254254
| :class:`c_wchar_p` | ``wchar_t *`` (NUL terminated) | unicode or ``None`` |
255255
+----------------------+--------------------------------+----------------------------+
256-
| :class:`c_void_p` | ``void *`` | int/long or ``None`` |
256+
| :class:`c_void_p` | ``void *`` | int or ``None`` |
257257
+----------------------+--------------------------------+----------------------------+
258258

259259

Doc/library/datetime.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ dates or times.
132132

133133
.. class:: timedelta([days[, seconds[, microseconds[, milliseconds[, minutes[, hours[, weeks]]]]]]])
134134

135-
All arguments are optional and default to ``0``. Arguments may be ints, longs,
135+
All arguments are optional and default to ``0``. Arguments may be integers
136136
or floats, and may be positive or negative.
137137

138138
Only *days*, *seconds* and *microseconds* are stored internally. Arguments are
@@ -213,7 +213,7 @@ Supported operations:
213213
| | == *t2* - *t3* and *t2* == *t1* + *t3* are |
214214
| | true. (1) |
215215
+--------------------------------+-----------------------------------------------+
216-
| ``t1 = t2 * i or t1 = i * t2`` | Delta multiplied by an integer or long. |
216+
| ``t1 = t2 * i or t1 = i * t2`` | Delta multiplied by an integer. |
217217
| | Afterwards *t1* // i == *t2* is true, |
218218
| | provided ``i != 0``. |
219219
+--------------------------------+-----------------------------------------------+
@@ -282,7 +282,7 @@ systems.
282282

283283
.. class:: date(year, month, day)
284284

285-
All arguments are required. Arguments may be ints or longs, in the following
285+
All arguments are required. Arguments may be integers, in the following
286286
ranges:
287287

288288
* ``MINYEAR <= year <= MAXYEAR``
@@ -503,8 +503,8 @@ Constructor:
503503
.. class:: datetime(year, month, day[, hour[, minute[, second[, microsecond[, tzinfo]]]]])
504504

505505
The year, month and day arguments are required. *tzinfo* may be ``None``, or an
506-
instance of a :class:`tzinfo` subclass. The remaining arguments may be ints or
507-
longs, in the following ranges:
506+
instance of a :class:`tzinfo` subclass. The remaining arguments may be integers,
507+
in the following ranges:
508508

509509
* ``MINYEAR <= year <= MAXYEAR``
510510
* ``1 <= month <= 12``
@@ -932,7 +932,7 @@ day, and subject to adjustment via a :class:`tzinfo` object.
932932
.. class:: time(hour[, minute[, second[, microsecond[, tzinfo]]]])
933933

934934
All arguments are optional. *tzinfo* may be ``None``, or an instance of a
935-
:class:`tzinfo` subclass. The remaining arguments may be ints or longs, in the
935+
:class:`tzinfo` subclass. The remaining arguments may be integers, in the
936936
following ranges:
937937

938938
* ``0 <= hour < 24``

Doc/library/doctest.rst

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,10 @@ Here's a complete but small example module::
3838
def factorial(n):
3939
"""Return the factorial of n, an exact integer >= 0.
4040

41-
If the result is small enough to fit in an int, return an int.
42-
Else return a long.
43-
4441
>>> [factorial(n) for n in range(6)]
4542
[1, 1, 2, 6, 24, 120]
46-
>>> [factorial(long(n)) for n in range(6)]
47-
[1, 1, 2, 6, 24, 120]
4843
>>> factorial(30)
49-
265252859812191058636308480000000L
50-
>>> factorial(30L)
51-
265252859812191058636308480000000L
44+
265252859812191058636308480000000
5245
>>> factorial(-1)
5346
Traceback (most recent call last):
5447
...
@@ -60,7 +53,7 @@ Here's a complete but small example module::
6053
...
6154
ValueError: n must be exact integer
6255
>>> factorial(30.0)
63-
265252859812191058636308480000000L
56+
265252859812191058636308480000000
6457

6558
It must also not be ridiculously large:
6659
>>> factorial(1e100)
@@ -109,11 +102,6 @@ it's trying, and prints a summary at the end::
109102
Expecting:
110103
[1, 1, 2, 6, 24, 120]
111104
ok
112-
Trying:
113-
[factorial(long(n)) for n in range(6)]
114-
Expecting:
115-
[1, 1, 2, 6, 24, 120]
116-
ok
117105

118106
And so on, eventually ending with::
119107

Doc/library/functions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ available. They are listed here in alphabetical order.
240240
interpreted as a complex number and the function must be called without a second
241241
parameter. The second parameter can never be a string. Each argument may be any
242242
numeric type (including complex). If *imag* is omitted, it defaults to zero and
243-
the function serves as a numeric conversion function like :func:`int`,
244-
:func:`long` and :func:`float`. If both arguments are omitted, returns ``0j``.
243+
the function serves as a numeric conversion function like :func:`int`
244+
and :func:`float`. If both arguments are omitted, returns ``0j``.
245245

246246
The complex type is described in :ref:`typesnumeric`.
247247

@@ -319,7 +319,7 @@ available. They are listed here in alphabetical order.
319319
.. function:: divmod(a, b)
320320

321321
Take two (non complex) numbers as arguments and return a pair of numbers
322-
consisting of their quotient and remainder when using long division. With mixed
322+
consisting of their quotient and remainder when using integer division. With mixed
323323
operand types, the rules for binary arithmetic operators apply. For integers,
324324
the result is the same as ``(a // b, a % b)``. For floating point
325325
numbers the result is ``(q, a % b)``, where *q* is usually ``math.floor(a / b)``

Doc/library/msilib.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ structures.
8383
containing all fields of a record according to the schema of the table. For
8484
optional fields, ``None`` can be passed.
8585

86-
Field values can be int or long numbers, strings, or instances of the Binary
87-
class.
86+
Field values can be integers, strings, or instances of the Binary class.
8887

8988

9089
.. class:: Binary(filename)

Doc/library/optparse.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ default from the option strings: if the first long option string is
364364
long option strings, :mod:`optparse` looks at the first short option string: the
365365
default destination for ``"-f"`` is ``f``.
366366

367-
:mod:`optparse` also includes built-in ``long`` and ``complex`` types. Adding
367+
:mod:`optparse` also includes the built-in ``complex`` type. Adding
368368
types is covered in section :ref:`optparse-extending-optparse`.
369369

370370

@@ -1103,14 +1103,14 @@ to a particular option, or fail to pass a required option attribute,
11031103
Standard option types
11041104
^^^^^^^^^^^^^^^^^^^^^
11051105

1106-
:mod:`optparse` has six built-in option types: ``string``, ``int``, ``long``,
1106+
:mod:`optparse` has five built-in option types: ``string``, ``int``,
11071107
``choice``, ``float`` and ``complex``. If you need to add new option types, see
11081108
section :ref:`optparse-extending-optparse`.
11091109

11101110
Arguments to string options are not checked or converted in any way: the text on
11111111
the command line is stored in the destination (or passed to the callback) as-is.
11121112

1113-
Integer arguments (type ``int`` or ``long``) are parsed as follows:
1113+
Integer arguments (type ``int``) are parsed as follows:
11141114

11151115
* if the number starts with ``0x``, it is parsed as a hexadecimal number
11161116

@@ -1121,9 +1121,9 @@ Integer arguments (type ``int`` or ``long``) are parsed as follows:
11211121
* otherwise, the number is parsed as a decimal number
11221122

11231123

1124-
The conversion is done by calling either ``int()`` or ``long()`` with the
1125-
appropriate base (2, 8, 10, or 16). If this fails, so will :mod:`optparse`,
1126-
although with a more useful error message.
1124+
The conversion is done by calling ``int()`` with the appropriate base (2, 8, 10,
1125+
or 16). If this fails, so will :mod:`optparse`, although with a more useful
1126+
error message.
11271127

11281128
``float`` and ``complex`` option arguments are converted directly with
11291129
``float()`` and ``complex()``, with similar error-handling.

Doc/library/posix.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ sometimes referred to as :dfn:`large files`.
5151

5252
Large file support is enabled in Python when the size of an :ctype:`off_t` is
5353
larger than a :ctype:`long` and the :ctype:`long long` type is available and is
54-
at least as large as an :ctype:`off_t`. Python longs are then used to represent
55-
file sizes, offsets and other values that can exceed the range of a Python int.
54+
at least as large as an :ctype:`off_t`.
5655
It may be necessary to configure and compile Python with certain compiler flags
5756
to enable this mode. For example, it is enabled by default with recent versions
5857
of Irix, but with Solaris 2.6 and 2.7 you need to do something like::

0 commit comments

Comments
 (0)