summaryrefslogtreecommitdiffstats
path: root/Modules/_pickle.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-08-27 16:40:23 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-08-27 16:40:23 (GMT)
commit9594942716a8f9c557b85d31751753d89cd7cebf (patch)
tree847ee3a06cf8831731d4aa0adaee961accc74fda /Modules/_pickle.c
parent4af4d273bd2c18e8e3d56dc43a877ce04a5a1e13 (diff)
downloadcpython-9594942716a8f9c557b85d31751753d89cd7cebf.zip
cpython-9594942716a8f9c557b85d31751753d89cd7cebf.tar.gz
cpython-9594942716a8f9c557b85d31751753d89cd7cebf.tar.bz2
Issue #18783: Removed existing mentions of Python long type in docstrings,
error messages and comments.
Diffstat (limited to 'Modules/_pickle.c')
-rw-r--r--Modules/_pickle.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c
index ce573cf..bc3b406 100644
--- a/Modules/_pickle.c
+++ b/Modules/_pickle.c
@@ -387,8 +387,8 @@ static PyTypeObject Unpickler_Type;
/*************************************************************************
- A custom hashtable mapping void* to longs. This is used by the pickler for
- memoization. Using a custom hashtable rather than PyDict allows us to skip
+ A custom hashtable mapping void* to Python ints. This is used by the pickler
+ for memoization. Using a custom hashtable rather than PyDict allows us to skip
a bunch of unnecessary object creation. This makes a huge performance
difference. */
@@ -1581,8 +1581,8 @@ save_long(PicklerObject *self, PyObject *obj)
* need another byte even if there aren't any leftovers:
* the most-significant bit of the most-significant byte
* acts like a sign bit, and it's usually got a sense
- * opposite of the one we need. The exception is longs
- * of the form -(2**(8*j-1)) for j > 0. Such a long is
+ * opposite of the one we need. The exception is ints
+ * of the form -(2**(8*j-1)) for j > 0. Such an int is
* its own 256's-complement, so has the right sign bit
* even without the extra byte. That's a pain to check
* for in advance, though, so we always grab an extra
@@ -1591,7 +1591,7 @@ save_long(PicklerObject *self, PyObject *obj)
nbytes = (nbits >> 3) + 1;
if (nbytes > 0x7fffffffL) {
PyErr_SetString(PyExc_OverflowError,
- "long too large to pickle");
+ "int too large to pickle");
goto error;
}
repr = PyBytes_FromStringAndSize(NULL, (Py_ssize_t)nbytes);
@@ -1603,7 +1603,7 @@ save_long(PicklerObject *self, PyObject *obj)
1 /* little endian */ , 1 /* signed */ );
if (i < 0)
goto error;
- /* If the long is negative, this may be a byte more than
+ /* If the int is negative, this may be a byte more than
* needed. This is so iff the MSB is all redundant sign
* bits.
*/
@@ -3917,7 +3917,7 @@ load_int(UnpicklerObject *self)
if (errno || (*endptr != '\n' && *endptr != '\0')) {
/* Hm, maybe we've got something long. Let's try reading
- * it as a Python long object. */
+ * it as a Python int object. */
errno = 0;
/* XXX: Same thing about the base here. */
value = PyLong_FromString(s, NULL, 0);