Skip to content

Commit 9594942

Browse files
Issue python#18783: Removed existing mentions of Python long type in docstrings,
error messages and comments.
1 parent 4af4d27 commit 9594942

40 files changed

Lines changed: 137 additions & 150 deletions

Doc/library/msilib.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,7 @@ structures.
8888
record according to the schema of the table. For optional fields,
8989
``None`` can be passed.
9090

91-
Field values can be int or long numbers, strings, or instances of the Binary
92-
class.
91+
Field values can be ints, strings, or instances of the Binary class.
9392

9493

9594
.. class:: Binary(filename)

Include/abstract.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
771771
PyAPI_FUNC(PyObject *) PyNumber_Index(PyObject *o);
772772

773773
/*
774-
Returns the object converted to a Python long or int
774+
Returns the object converted to a Python int
775775
or NULL with an error raised on failure.
776776
*/
777777

@@ -780,7 +780,7 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
780780
/*
781781
Returns the object converted to Py_ssize_t by going through
782782
PyNumber_Index first. If an overflow error occurs while
783-
converting the int-or-long to Py_ssize_t, then the second argument
783+
converting the int to Py_ssize_t, then the second argument
784784
is the error-type to return. If it is NULL, then the overflow error
785785
is cleared and the value is clipped.
786786
*/

Include/longintrepr.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ extern "C" {
88

99
/* This is published for the benefit of "friends" marshal.c and _decimal.c. */
1010

11-
/* Parameters of the long integer representation. There are two different
11+
/* Parameters of the integer representation. There are two different
1212
sets of parameters: one set for 30-bit digits, stored in an unsigned 32-bit
1313
integer type, and one set for 15-bit digits with each digit stored in an
1414
unsigned short. The value of PYLONG_BITS_IN_DIGIT, defined either at
@@ -29,7 +29,7 @@ extern "C" {
2929
of bits in an unsigned long, as do the PyLong <-> long (or unsigned long)
3030
conversion functions
3131
32-
- the long <-> size_t/Py_ssize_t conversion functions expect that
32+
- the Python int <-> size_t/Py_ssize_t conversion functions expect that
3333
PyLong_SHIFT is strictly less than the number of bits in a size_t
3434
3535
- the marshal code currently expects that PyLong_SHIFT is a multiple of 15
@@ -83,7 +83,7 @@ typedef long stwodigits; /* signed variant of twodigits */
8383
so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available.
8484
8585
CAUTION: Generic code manipulating subtypes of PyVarObject has to
86-
aware that longs abuse ob_size's sign bit.
86+
aware that ints abuse ob_size's sign bit.
8787
*/
8888

8989
struct _longobject {

Include/longobject.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ PyAPI_FUNC(size_t) _PyLong_NumBits(PyObject *v);
113113
PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *);
114114

115115
/* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in
116-
base 256, and return a Python long with the same numeric value.
116+
base 256, and return a Python int with the same numeric value.
117117
If n is 0, the integer is 0. Else:
118118
If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB;
119119
else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the
@@ -123,7 +123,7 @@ PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *);
123123
non-negative if bit 0x80 of the MSB is clear, negative if set.
124124
Error returns:
125125
+ Return NULL with the appropriate exception set if there's not
126-
enough memory to create the Python long.
126+
enough memory to create the Python int.
127127
*/
128128
PyAPI_FUNC(PyObject *) _PyLong_FromByteArray(
129129
const unsigned char* bytes, size_t n,
@@ -173,7 +173,7 @@ PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter(
173173
Py_ssize_t end);
174174
#endif /* Py_LIMITED_API */
175175

176-
/* These aren't really part of the long object, but they're handy. The
176+
/* These aren't really part of the int object, but they're handy. The
177177
functions are in Python/mystrtoul.c.
178178
*/
179179
PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int);

Include/objimpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
171171
value is rounded up to the closest multiple of sizeof(void *), in order to
172172
ensure that pointer fields at the end of the object are correctly aligned
173173
for the platform (this is of special importance for subclasses of, e.g.,
174-
str or long, so that pointers can be stored after the embedded data).
174+
str or int, so that pointers can be stored after the embedded data).
175175
176176
Note that there's no memory wastage in doing this, as malloc has to
177177
return (at worst) pointer-aligned memory anyway.

Include/pyport.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Used in: PY_LONG_LONG
8080
#endif
8181
#endif /* HAVE_LONG_LONG */
8282

83-
/* a build with 30-bit digits for Python long integers needs an exact-width
83+
/* a build with 30-bit digits for Python integers needs an exact-width
8484
* 32-bit unsigned integer type to store those digits. (We could just use
8585
* type 'unsigned long', but that would be wasteful on a system where longs
8686
* are 64-bits.) On Unix systems, the autoconf macro AC_TYPE_UINT32_T defines
@@ -98,7 +98,7 @@ Used in: PY_LONG_LONG
9898
#endif
9999

100100
/* Macros for a 64-bit unsigned integer type; used for type 'twodigits' in the
101-
* long integer implementation, when 30-bit digits are enabled.
101+
* integer implementation, when 30-bit digits are enabled.
102102
*/
103103
#ifdef uint64_t
104104
#define HAVE_UINT64_T 1

Lib/ctypes/test/test_numbers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def test_byref(self):
104104

105105
def test_floats(self):
106106
# c_float and c_double can be created from
107-
# Python int, long and float
107+
# Python int and float
108108
class FloatLike(object):
109109
def __float__(self):
110110
return 2.0

Lib/datetime.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ class timedelta:
287287
- add, subtract timedelta
288288
- unary plus, minus, abs
289289
- compare to timedelta
290-
- multiply, divide by int/long
290+
- multiply, divide by int
291291
292292
In addition, datetime supports subtraction of two datetime objects
293293
returning a timedelta, and addition or subtraction of a datetime
@@ -1290,7 +1290,7 @@ class datetime(date):
12901290
"""datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])
12911291
12921292
The year, month and day arguments are required. tzinfo may be None, or an
1293-
instance of a tzinfo subclass. The remaining arguments may be ints or longs.
1293+
instance of a tzinfo subclass. The remaining arguments may be ints.
12941294
"""
12951295

12961296
__slots__ = date.__slots__ + (

Lib/pickle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ def load_stop(self):
12701270
raise _Stop(value)
12711271
dispatch[STOP[0]] = load_stop
12721272

1273-
# Encode/decode longs.
1273+
# Encode/decode ints.
12741274

12751275
def encode_long(x):
12761276
r"""Encode a long to a two's complement little-endian binary string.
@@ -1303,7 +1303,7 @@ def encode_long(x):
13031303
return result
13041304

13051305
def decode_long(data):
1306-
r"""Decode a long from a two's complement little-endian binary string.
1306+
r"""Decode an int from a two's complement little-endian binary string.
13071307
13081308
>>> decode_long(b'')
13091309
0

Lib/pickletools.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -580,16 +580,12 @@ def read_decimalnl_short(f):
580580
>>> read_decimalnl_short(io.BytesIO(b"1234L\n56"))
581581
Traceback (most recent call last):
582582
...
583-
ValueError: trailing 'L' not allowed in b'1234L'
583+
ValueError: invalid literal for int() with base 10: b'1234L'
584584
"""
585585

586586
s = read_stringnl(f, decode=False, stripquotes=False)
587-
if s.endswith(b"L"):
588-
raise ValueError("trailing 'L' not allowed in %r" % s)
589587

590-
# It's not necessarily true that the result fits in a Python short int:
591-
# the pickle may have been written on a 64-bit box. There's also a hack
592-
# for True and False here.
588+
# There's a hack for True and False here.
593589
if s == b"00":
594590
return False
595591
elif s == b"01":

0 commit comments

Comments
 (0)