summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-08-27 17:17:03 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-08-27 17:17:03 (GMT)
commit46e1ce214b5711e8dae63a1b5a0a7aafb371baf0 (patch)
tree0230554f5bd4df8804946f5bb0634cefdbbbd2ae /Modules
parent14e461d5b92000ec4e89182fa25ab0d5b5b31234 (diff)
parent9594942716a8f9c557b85d31751753d89cd7cebf (diff)
downloadcpython-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')
-rw-r--r--Modules/_ctypes/callproc.c2
-rw-r--r--Modules/_datetimemodule.c14
-rw-r--r--Modules/_pickle.c14
-rw-r--r--Modules/_randommodule.c2
-rw-r--r--Modules/_struct.c2
-rw-r--r--Modules/_testcapimodule.c2
-rw-r--r--Modules/mathmodule.c13
-rw-r--r--Modules/socketmodule.c8
8 files changed, 28 insertions, 29 deletions
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index ead1c6f..74119a3 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -652,7 +652,7 @@ static int ConvParam(PyObject *obj, Py_ssize_t index, struct argument *pa)
pa->value.i = PyLong_AsLong(obj);
if (pa->value.i == -1 && PyErr_Occurred()) {
PyErr_SetString(PyExc_OverflowError,
- "long int too long to convert");
+ "int too long to convert");
return -1;
}
}
diff --git a/Modules/_datetimemodule.c b/Modules/_datetimemodule.c
index 91d30a0..1836310 100644
--- a/Modules/_datetimemodule.c
+++ b/Modules/_datetimemodule.c
@@ -1388,9 +1388,9 @@ static PyObject *one = NULL; /* 1 */
static PyObject *us_per_ms = NULL; /* 1000 */
static PyObject *us_per_second = NULL; /* 1000000 */
static PyObject *us_per_minute = NULL; /* 1e6 * 60 as Python int */
-static PyObject *us_per_hour = NULL; /* 1e6 * 3600 as Python long */
-static PyObject *us_per_day = NULL; /* 1e6 * 3600 * 24 as Python long */
-static PyObject *us_per_week = NULL; /* 1e6*3600*24*7 as Python long */
+static PyObject *us_per_hour = NULL; /* 1e6 * 3600 as Python int */
+static PyObject *us_per_day = NULL; /* 1e6 * 3600 * 24 as Python int */
+static PyObject *us_per_week = NULL; /* 1e6*3600*24*7 as Python int */
static PyObject *seconds_per_day = NULL; /* 3600*24 as Python int */
/* ---------------------------------------------------------------------------
@@ -1403,7 +1403,7 @@ static PyObject *seconds_per_day = NULL; /* 3600*24 as Python int */
/* Convert a timedelta to a number of us,
* (24*3600*self.days + self.seconds)*1000000 + self.microseconds
- * as a Python int or long.
+ * as a Python int.
* Doing mixed-radix arithmetic by hand instead is excruciating in C,
* due to ubiquitous overflow possibilities.
*/
@@ -1455,7 +1455,7 @@ Done:
return result;
}
-/* Convert a number of us (as a Python int or long) to a timedelta.
+/* Convert a number of us (as a Python int) to a timedelta.
*/
static PyObject *
microseconds_to_delta_ex(PyObject *pyus, PyTypeObject *type)
@@ -3891,7 +3891,7 @@ static char time_doc[] =
PyDoc_STR("time([hour[, minute[, second[, microsecond[, tzinfo]]]]]) --> a time object\n\
\n\
All arguments are optional. tzinfo may be None, or an instance of\n\
-a tzinfo subclass. The remaining arguments may be ints or longs.\n");
+a tzinfo subclass. The remaining arguments may be ints.\n");
static PyNumberMethods time_as_number = {
0, /* nb_add */
@@ -5081,7 +5081,7 @@ static char datetime_doc[] =
PyDoc_STR("datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\
\n\
The year, month and day arguments are required. tzinfo may be None, or an\n\
-instance of a tzinfo subclass. The remaining arguments may be ints or longs.\n");
+instance of a tzinfo subclass. The remaining arguments may be ints.\n");
static PyNumberMethods datetime_as_number = {
datetime_add, /* nb_add */
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);
diff --git a/Modules/_randommodule.c b/Modules/_randommodule.c
index 59c15b3..1fa899c 100644
--- a/Modules/_randommodule.c
+++ b/Modules/_randommodule.c
@@ -421,7 +421,7 @@ static PyMethodDef random_methods[] = {
{"setstate", (PyCFunction)random_setstate, METH_O,
PyDoc_STR("setstate(state) -> None. Restores generator state.")},
{"getrandbits", (PyCFunction)random_getrandbits, METH_VARARGS,
- PyDoc_STR("getrandbits(k) -> x. Generates a long int with "
+ PyDoc_STR("getrandbits(k) -> x. Generates an int with "
"k random bits.")},
{NULL, NULL} /* sentinel */
};
diff --git a/Modules/_struct.c b/Modules/_struct.c
index 5848b19..3d515d5 100644
--- a/Modules/_struct.c
+++ b/Modules/_struct.c
@@ -1779,7 +1779,7 @@ s_pack_internal(PyStructObject *soself, PyObject *args, int offset, char* buf)
if (e->pack(res, v, e) < 0) {
if (PyLong_Check(v) && PyErr_ExceptionMatches(PyExc_OverflowError))
PyErr_SetString(StructError,
- "long too large to convert to int");
+ "int too large to convert");
return -1;
}
}
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 59d3182..34b95c0 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -1649,7 +1649,7 @@ test_long_numbits(PyObject *self)
{-3L, 2, -1},
{4L, 3, 1},
{-4L, 3, -1},
- {0x7fffL, 15, 1}, /* one Python long digit */
+ {0x7fffL, 15, 1}, /* one Python int digit */
{-0x7fffL, 15, -1},
{0xffffL, 16, 1},
{-0xffffL, 16, -1},
diff --git a/Modules/mathmodule.c b/Modules/mathmodule.c
index 3fa52d0..4b3e642 100644
--- a/Modules/mathmodule.c
+++ b/Modules/mathmodule.c
@@ -1535,8 +1535,7 @@ math_ldexp(PyObject *self, PyObject *args)
}
else {
PyErr_SetString(PyExc_TypeError,
- "Expected an int or long as second argument "
- "to ldexp.");
+ "Expected an int as second argument to ldexp.");
return NULL;
}
@@ -1598,19 +1597,19 @@ PyDoc_STRVAR(math_modf_doc,
"Return the fractional and integer parts of x. Both results carry the sign\n"
"of x and are floats.");
-/* A decent logarithm is easy to compute even for huge longs, but libm can't
+/* A decent logarithm is easy to compute even for huge ints, but libm can't
do that by itself -- loghelper can. func is log or log10, and name is
- "log" or "log10". Note that overflow of the result isn't possible: a long
+ "log" or "log10". Note that overflow of the result isn't possible: an int
can contain no more than INT_MAX * SHIFT bits, so has value certainly less
than 2**(2**64 * 2**16) == 2**2**80, and log2 of that is 2**80, which is
small enough to fit in an IEEE single. log and log10 are even smaller.
- However, intermediate overflow is possible for a long if the number of bits
- in that long is larger than PY_SSIZE_T_MAX. */
+ However, intermediate overflow is possible for an int if the number of bits
+ in that int is larger than PY_SSIZE_T_MAX. */
static PyObject*
loghelper(PyObject* arg, double (*func)(double), char *funcname)
{
- /* If it is long, do it ourselves. */
+ /* If it is int, do it ourselves. */
if (PyLong_Check(arg)) {
double x, result;
Py_ssize_t e;
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 1e2e84f..c5efbc1 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -4654,14 +4654,14 @@ socket_ntohl(PyObject *self, PyObject *arg)
y = x & 0xFFFFFFFFUL;
if (y ^ x)
return PyErr_Format(PyExc_OverflowError,
- "long int larger than 32 bits");
+ "int larger than 32 bits");
x = y;
}
#endif
}
else
return PyErr_Format(PyExc_TypeError,
- "expected int/long, %s found",
+ "expected int, %s found",
Py_TYPE(arg)->tp_name);
return PyLong_FromUnsignedLong(ntohl(x));
}
@@ -4711,14 +4711,14 @@ socket_htonl(PyObject *self, PyObject *arg)
y = x & 0xFFFFFFFFUL;
if (y ^ x)
return PyErr_Format(PyExc_OverflowError,
- "long int larger than 32 bits");
+ "int larger than 32 bits");
x = y;
}
#endif
}
else
return PyErr_Format(PyExc_TypeError,
- "expected int/long, %s found",
+ "expected int, %s found",
Py_TYPE(arg)->tp_name);
return PyLong_FromUnsignedLong(htonl((unsigned long)x));
}