diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-08-27 17:17:03 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-08-27 17:17:03 (GMT) |
commit | 46e1ce214b5711e8dae63a1b5a0a7aafb371baf0 (patch) | |
tree | 0230554f5bd4df8804946f5bb0634cefdbbbd2ae /Modules/_pickle.c | |
parent | 14e461d5b92000ec4e89182fa25ab0d5b5b31234 (diff) | |
parent | 9594942716a8f9c557b85d31751753d89cd7cebf (diff) | |
download | cpython-46e1ce214b5711e8dae63a1b5a0a7aafb371baf0.zip cpython-46e1ce214b5711e8dae63a1b5a0a7aafb371baf0.tar.gz cpython-46e1ce214b5711e8dae63a1b5a0a7aafb371baf0.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.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Modules/_pickle.c b/Modules/_pickle.c index af73a84..f79fad3 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. */ @@ -1580,8 +1580,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 @@ -1590,7 +1590,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); @@ -1602,7 +1602,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. */ @@ -3952,7 +3952,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); |