Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 46e1ce2

Browse files
Issue #18783: Removed existing mentions of Python long type in docstrings,
error messages and comments.
2 parents 14e461d + 9594942 commit 46e1ce2

40 files changed

Lines changed: 140 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
@@ -776,7 +776,7 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
776776
PyAPI_FUNC(PyObject *) PyNumber_Index(PyObject *o);
777777

778778
/*
779-
Returns the object converted to a Python long or int
779+
Returns the object converted to a Python int
780780
or NULL with an error raised on failure.
781781
*/
782782

@@ -785,7 +785,7 @@ PyAPI_FUNC(Py_ssize_t) PyObject_LengthHint(PyObject *o, Py_ssize_t);
785785
/*
786786
Returns the object converted to Py_ssize_t by going through
787787
PyNumber_Index first. If an overflow error occurs while
788-
converting the int-or-long to Py_ssize_t, then the second argument
788+
converting the int to Py_ssize_t, then the second argument
789789
is the error-type to return. If it is NULL, then the overflow error
790790
is cleared and the value is clipped.
791791
*/

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
@@ -126,7 +126,7 @@ PyAPI_FUNC(size_t) _PyLong_NumBits(PyObject *v);
126126
PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *);
127127

128128
/* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in
129-
base 256, and return a Python long with the same numeric value.
129+
base 256, and return a Python int with the same numeric value.
130130
If n is 0, the integer is 0. Else:
131131
If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB;
132132
else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the
@@ -136,7 +136,7 @@ PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *);
136136
non-negative if bit 0x80 of the MSB is clear, negative if set.
137137
Error returns:
138138
+ Return NULL with the appropriate exception set if there's not
139-
enough memory to create the Python long.
139+
enough memory to create the Python int.
140140
*/
141141
PyAPI_FUNC(PyObject *) _PyLong_FromByteArray(
142142
const unsigned char* bytes, size_t n,
@@ -186,7 +186,7 @@ PyAPI_FUNC(int) _PyLong_FormatAdvancedWriter(
186186
Py_ssize_t end);
187187
#endif /* Py_LIMITED_API */
188188

189-
/* These aren't really part of the long object, but they're handy. The
189+
/* These aren't really part of the int object, but they're handy. The
190190
functions are in Python/mystrtoul.c.
191191
*/
192192
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
@@ -147,7 +147,7 @@ PyAPI_FUNC(PyVarObject *) _PyObject_NewVar(PyTypeObject *, Py_ssize_t);
147147
value is rounded up to the closest multiple of sizeof(void *), in order to
148148
ensure that pointer fields at the end of the object are correctly aligned
149149
for the platform (this is of special importance for subclasses of, e.g.,
150-
str or long, so that pointers can be stored after the embedded data).
150+
str or int, so that pointers can be stored after the embedded data).
151151
152152
Note that there's no memory wastage in doing this, as malloc has to
153153
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
@@ -1218,7 +1218,7 @@ def load_stop(self):
12181218
raise _Stop(value)
12191219
dispatch[STOP[0]] = load_stop
12201220

1221-
# Encode/decode longs.
1221+
# Encode/decode ints.
12221222

12231223
def encode_long(x):
12241224
r"""Encode a long to a two's complement little-endian binary string.
@@ -1251,7 +1251,7 @@ def encode_long(x):
12511251
return result
12521252

12531253
def decode_long(data):
1254-
r"""Decode a long from a two's complement little-endian binary string.
1254+
r"""Decode an int from a two's complement little-endian binary string.
12551255
12561256
>>> decode_long(b'')
12571257
0

Lib/pickletools.py

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

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

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

0 commit comments

Comments
 (0)