diff -r 464eed5ddb2e Doc/library/msilib.rst --- a/Doc/library/msilib.rst Mon Aug 19 10:03:11 2013 +0300 +++ b/Doc/library/msilib.rst Mon Aug 19 20:30:00 2013 +0300 @@ -88,7 +88,7 @@ record according to the schema of the table. For optional fields, ``None`` can be passed. - Field values can be int or long numbers, strings, or instances of the Binary + Field values can be int numbers, strings, or instances of the Binary class. diff -r 464eed5ddb2e Include/abstract.h --- a/Include/abstract.h Mon Aug 19 10:03:11 2013 +0300 +++ b/Include/abstract.h Mon Aug 19 20:30:00 2013 +0300 @@ -776,7 +776,7 @@ PyAPI_FUNC(PyObject *) PyNumber_Index(PyObject *o); /* - Returns the object converted to a Python long or int + Returns the object converted to a Python int or NULL with an error raised on failure. */ @@ -785,7 +785,7 @@ /* Returns the object converted to Py_ssize_t by going through PyNumber_Index first. If an overflow error occurs while - converting the int-or-long to Py_ssize_t, then the second argument + converting the int to Py_ssize_t, then the second argument is the error-type to return. If it is NULL, then the overflow error is cleared and the value is clipped. */ diff -r 464eed5ddb2e Include/longintrepr.h --- a/Include/longintrepr.h Mon Aug 19 10:03:11 2013 +0300 +++ b/Include/longintrepr.h Mon Aug 19 20:30:00 2013 +0300 @@ -8,7 +8,7 @@ /* This is published for the benefit of "friends" marshal.c and _decimal.c. */ -/* Parameters of the long integer representation. There are two different +/* Parameters of the integer representation. There are two different sets of parameters: one set for 30-bit digits, stored in an unsigned 32-bit integer type, and one set for 15-bit digits with each digit stored in an unsigned short. The value of PYLONG_BITS_IN_DIGIT, defined either at @@ -29,7 +29,7 @@ of bits in an unsigned long, as do the PyLong <-> long (or unsigned long) conversion functions - - the long <-> size_t/Py_ssize_t conversion functions expect that + - the Python int <-> size_t/Py_ssize_t conversion functions expect that PyLong_SHIFT is strictly less than the number of bits in a size_t - the marshal code currently expects that PyLong_SHIFT is a multiple of 15 @@ -83,7 +83,7 @@ so that ob_digit[0] ... ob_digit[abs(ob_size)-1] are actually available. CAUTION: Generic code manipulating subtypes of PyVarObject has to - aware that longs abuse ob_size's sign bit. + aware that ints abuse ob_size's sign bit. */ struct _longobject { diff -r 464eed5ddb2e Include/longobject.h --- a/Include/longobject.h Mon Aug 19 10:03:11 2013 +0300 +++ b/Include/longobject.h Mon Aug 19 20:30:00 2013 +0300 @@ -126,7 +126,7 @@ PyAPI_FUNC(PyObject *) _PyLong_DivmodNear(PyObject *, PyObject *); /* _PyLong_FromByteArray: View the n unsigned bytes as a binary integer in - base 256, and return a Python long with the same numeric value. + base 256, and return a Python int with the same numeric value. If n is 0, the integer is 0. Else: If little_endian is 1/true, bytes[n-1] is the MSB and bytes[0] the LSB; else (little_endian is 0/false) bytes[0] is the MSB and bytes[n-1] the @@ -136,7 +136,7 @@ non-negative if bit 0x80 of the MSB is clear, negative if set. Error returns: + Return NULL with the appropriate exception set if there's not - enough memory to create the Python long. + enough memory to create the Python int. */ PyAPI_FUNC(PyObject *) _PyLong_FromByteArray( const unsigned char* bytes, size_t n, @@ -186,7 +186,7 @@ Py_ssize_t end); #endif /* Py_LIMITED_API */ -/* These aren't really part of the long object, but they're handy. The +/* These aren't really part of the int object, but they're handy. The functions are in Python/mystrtoul.c. */ PyAPI_FUNC(unsigned long) PyOS_strtoul(char *, char **, int); diff -r 464eed5ddb2e Include/objimpl.h --- a/Include/objimpl.h Mon Aug 19 10:03:11 2013 +0300 +++ b/Include/objimpl.h Mon Aug 19 20:30:00 2013 +0300 @@ -147,7 +147,7 @@ value is rounded up to the closest multiple of sizeof(void *), in order to ensure that pointer fields at the end of the object are correctly aligned for the platform (this is of special importance for subclasses of, e.g., - str or long, so that pointers can be stored after the embedded data). + str or int, so that pointers can be stored after the embedded data). Note that there's no memory wastage in doing this, as malloc has to return (at worst) pointer-aligned memory anyway. diff -r 464eed5ddb2e Include/pyport.h --- a/Include/pyport.h Mon Aug 19 10:03:11 2013 +0300 +++ b/Include/pyport.h Mon Aug 19 20:30:00 2013 +0300 @@ -80,7 +80,7 @@ #endif #endif /* HAVE_LONG_LONG */ -/* a build with 30-bit digits for Python long integers needs an exact-width +/* a build with 30-bit digits for Python integers needs an exact-width * 32-bit unsigned integer type to store those digits. (We could just use * type 'unsigned long', but that would be wasteful on a system where longs * are 64-bits.) On Unix systems, the autoconf macro AC_TYPE_UINT32_T defines @@ -98,7 +98,7 @@ #endif /* Macros for a 64-bit unsigned integer type; used for type 'twodigits' in the - * long integer implementation, when 30-bit digits are enabled. + * integer implementation, when 30-bit digits are enabled. */ #ifdef uint64_t #define HAVE_UINT64_T 1 diff -r 464eed5ddb2e Lib/ctypes/test/test_numbers.py --- a/Lib/ctypes/test/test_numbers.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/ctypes/test/test_numbers.py Mon Aug 19 20:30:00 2013 +0300 @@ -104,7 +104,7 @@ def test_floats(self): # c_float and c_double can be created from - # Python int, long and float + # Python int and float class FloatLike(object): def __float__(self): return 2.0 diff -r 464eed5ddb2e Lib/datetime.py --- a/Lib/datetime.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/datetime.py Mon Aug 19 20:30:00 2013 +0300 @@ -287,7 +287,7 @@ - add, subtract timedelta - unary plus, minus, abs - compare to timedelta - - multiply, divide by int/long + - multiply, divide by int In addition, datetime supports subtraction of two datetime objects returning a timedelta, and addition or subtraction of a datetime @@ -1290,7 +1290,7 @@ """datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]]) The year, month and day arguments are required. tzinfo may be None, or an - instance of a tzinfo subclass. The remaining arguments may be ints or longs. + instance of a tzinfo subclass. The remaining arguments may be ints. """ __slots__ = date.__slots__ + ( diff -r 464eed5ddb2e Lib/pickle.py --- a/Lib/pickle.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/pickle.py Mon Aug 19 20:30:00 2013 +0300 @@ -1218,7 +1218,7 @@ raise _Stop(value) dispatch[STOP[0]] = load_stop -# Encode/decode longs. +# Encode/decode ints. def encode_long(x): r"""Encode a long to a two's complement little-endian binary string. @@ -1251,7 +1251,7 @@ return result def decode_long(data): - r"""Decode a long from a two's complement little-endian binary string. + r"""Decode an int from a two's complement little-endian binary string. >>> decode_long(b'') 0 diff -r 464eed5ddb2e Lib/pickletools.py --- a/Lib/pickletools.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/pickletools.py Mon Aug 19 20:30:00 2013 +0300 @@ -579,16 +579,11 @@ >>> read_decimalnl_short(io.BytesIO(b"1234L\n56")) Traceback (most recent call last): ... - ValueError: trailing 'L' not allowed in b'1234L' + ValueError: invalid literal for int() with base 10: b'1234L' """ s = read_stringnl(f, decode=False, stripquotes=False) - if s.endswith(b"L"): - raise ValueError("trailing 'L' not allowed in %r" % s) - # It's not necessarily true that the result fits in a Python short int: - # the pickle may have been written on a 64-bit box. There's also a hack - # for True and False here. if s == b"00": return False elif s == b"01": diff -r 464eed5ddb2e Lib/random.py --- a/Lib/random.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/random.py Mon Aug 19 20:30:00 2013 +0300 @@ -637,7 +637,7 @@ return (int.from_bytes(_urandom(7), 'big') >> 3) * RECIP_BPF def getrandbits(self, k): - """getrandbits(k) -> x. Generates a long int with k random bits.""" + """getrandbits(k) -> x. Generates an int with k random bits.""" if k <= 0: raise ValueError('number of bits must be greater than zero') if k != int(k): diff -r 464eed5ddb2e Lib/test/test_cmath.py --- a/Lib/test/test_cmath.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/test/test_cmath.py Mon Aug 19 20:30:00 2013 +0300 @@ -253,7 +253,7 @@ self.assertRaises(SomeException, f, MyComplexExceptionOS()) def test_input_type(self): - # ints and longs should be acceptable inputs to all cmath + # ints should be acceptable inputs to all cmath # functions, by virtue of providing a __float__ method for f in self.test_functions: for arg in [2, 2.]: diff -r 464eed5ddb2e Lib/test/test_compile.py --- a/Lib/test/test_compile.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/test/test_compile.py Mon Aug 19 20:30:00 2013 +0300 @@ -198,7 +198,7 @@ else: self.fail("How many bits *does* this machine have???") # Verify treatment of constant folding on -(sys.maxsize+1) - # i.e. -2147483648 on 32 bit platforms. Should return int, not long. + # i.e. -2147483648 on 32 bit platforms. Should return int. self.assertIsInstance(eval("%s" % (-sys.maxsize - 1)), int) self.assertIsInstance(eval("%s" % (-sys.maxsize - 2)), int) diff -r 464eed5ddb2e Lib/test/test_decimal.py --- a/Lib/test/test_decimal.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/test/test_decimal.py Mon Aug 19 20:30:00 2013 +0300 @@ -1837,7 +1837,7 @@ self.assertIs(max(d1,d2), d2) self.assertIs(max(d2,d1), d2) - #between Decimal and long + #between Decimal and int self.assertIs(min(d1,l2), d1) self.assertIs(min(l2,d1), d1) self.assertIs(max(l1,d2), d2) diff -r 464eed5ddb2e Lib/test/test_gdb.py --- a/Lib/test/test_gdb.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/test/test_gdb.py Mon Aug 19 20:30:00 2013 +0300 @@ -228,7 +228,7 @@ % (gdb_repr, exp_repr, gdb_output))) def test_int(self): - 'Verify the pretty-printing of various "int"/long values' + 'Verify the pretty-printing of various int values' self.assertGdbRepr(42) self.assertGdbRepr(0) self.assertGdbRepr(-7) diff -r 464eed5ddb2e Lib/test/test_itertools.py --- a/Lib/test/test_itertools.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/test/test_itertools.py Mon Aug 19 20:30:00 2013 +0300 @@ -505,9 +505,9 @@ self.assertEqual(repr(count(10.25)), 'count(10.25)') self.assertEqual(next(c), -8) for i in (-sys.maxsize-5, -sys.maxsize+5 ,-10, -1, 0, 10, sys.maxsize-5, sys.maxsize+5): - # Test repr (ignoring the L in longs) - r1 = repr(count(i)).replace('L', '') - r2 = 'count(%r)'.__mod__(i).replace('L', '') + # Test repr + r1 = repr(count(i)) + r2 = 'count(%r)'.__mod__(i) self.assertEqual(r1, r2) # check copy, deepcopy, pickle @@ -555,12 +555,12 @@ self.assertEqual(repr(count(10.5, 1.00)), 'count(10.5, 1.0)') # do show float values lilke 1.0 for i in (-sys.maxsize-5, -sys.maxsize+5 ,-10, -1, 0, 10, sys.maxsize-5, sys.maxsize+5): for j in (-sys.maxsize-5, -sys.maxsize+5 ,-10, -1, 0, 1, 10, sys.maxsize-5, sys.maxsize+5): - # Test repr (ignoring the L in longs) - r1 = repr(count(i, j)).replace('L', '') + # Test repr + r1 = repr(count(i, j)) if j == 1: - r2 = ('count(%r)' % i).replace('L', '') + r2 = ('count(%r)' % i) else: - r2 = ('count(%r, %r)' % (i, j)).replace('L', '') + r2 = ('count(%r, %r)' % (i, j)) self.assertEqual(r1, r2) self.pickletest(count(i, j)) diff -r 464eed5ddb2e Lib/test/test_long.py --- a/Lib/test/test_long.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/test/test_long.py Mon Aug 19 20:30:00 2013 +0300 @@ -322,20 +322,13 @@ "".join("0123456789abcdef"[i] for i in digits) def check_format_1(self, x): - for base, mapper in (8, oct), (10, repr), (16, hex): + for base, mapper in (2, bin), (8, oct), (10, str), (10, repr), (16, hex): got = mapper(x) expected = self.slow_format(x, base) msg = Frm("%s returned %r but expected %r for %r", mapper.__name__, got, expected, x) self.assertEqual(got, expected, msg) self.assertEqual(int(got, 0), x, Frm('int("%s", 0) != %r', got, x)) - # str() has to be checked a little differently since there's no - # trailing "L" - got = str(x) - expected = self.slow_format(x, 10) - msg = Frm("%s returned %r but expected %r for %r", - mapper.__name__, got, expected, x) - self.assertEqual(got, expected, msg) def test_format(self): for x in special: @@ -553,11 +546,11 @@ def test_mixed_compares(self): eq = self.assertEqual - # We're mostly concerned with that mixing floats and longs does the - # right stuff, even when longs are too large to fit in a float. + # We're mostly concerned with that mixing floats and ints does the + # right stuff, even when ints are too large to fit in a float. # The safest way to check the results is to use an entirely different # method, which we do here via a skeletal rational class (which - # represents all Python ints, longs and floats exactly). + # represents all Python ints and floats exactly). class Rat: def __init__(self, value): if isinstance(value, int): diff -r 464eed5ddb2e Lib/test/test_struct.py --- a/Lib/test/test_struct.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/test/test_struct.py Mon Aug 19 20:30:00 2013 +0300 @@ -279,7 +279,7 @@ # Objects with an '__index__' method should be allowed # to pack as integers. That is assuming the implemented - # '__index__' method returns and 'int' or 'long'. + # '__index__' method returns an 'int'. class Indexable(object): def __init__(self, value): self._value = value diff -r 464eed5ddb2e Lib/test/test_sys.py --- a/Lib/test/test_sys.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/test/test_sys.py Mon Aug 19 20:30:00 2013 +0300 @@ -799,7 +799,7 @@ check(iter([]), size('lP')) # listreverseiterator (list) check(reversed([]), size('nP')) - # long + # int check(0, vsize('')) check(1, vsize('') + self.longdigit) check(-1, vsize('') + self.longdigit) diff -r 464eed5ddb2e Lib/xmlrpc/client.py --- a/Lib/xmlrpc/client.py Mon Aug 19 10:03:11 2013 +0300 +++ b/Lib/xmlrpc/client.py Mon Aug 19 20:30:00 2013 +0300 @@ -539,7 +539,7 @@ def dump_long(self, value, write): if value > MAXINT or value < MININT: - raise OverflowError("long int exceeds XML-RPC limits") + raise OverflowError("int exceeds XML-RPC limits") write("") write(str(int(value))) write("\n") diff -r 464eed5ddb2e Modules/_ctypes/callproc.c --- a/Modules/_ctypes/callproc.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Modules/_ctypes/callproc.c Mon Aug 19 20:30:00 2013 +0300 @@ -652,7 +652,7 @@ 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 -r 464eed5ddb2e Modules/_datetimemodule.c --- a/Modules/_datetimemodule.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Modules/_datetimemodule.c Mon Aug 19 20:30:00 2013 +0300 @@ -1388,9 +1388,9 @@ 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 @@ /* 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 @@ 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 @@ 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 @@ 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 -r 464eed5ddb2e Modules/_pickle.c --- a/Modules/_pickle.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Modules/_pickle.c Mon Aug 19 20:30:00 2013 +0300 @@ -387,8 +387,8 @@ /************************************************************************* - 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 @@ * 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 @@ 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 @@ 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 @@ 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 -r 464eed5ddb2e Modules/_randommodule.c --- a/Modules/_randommodule.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Modules/_randommodule.c Mon Aug 19 20:30:00 2013 +0300 @@ -421,7 +421,7 @@ {"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 -r 464eed5ddb2e Modules/_struct.c --- a/Modules/_struct.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Modules/_struct.c Mon Aug 19 20:30:00 2013 +0300 @@ -1778,8 +1778,9 @@ } else { 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"); + PyErr_Format(StructError, + "int too large to convert to %d-bit int", + (int)(8 * e->size)); return -1; } } diff -r 464eed5ddb2e Modules/_testcapimodule.c --- a/Modules/_testcapimodule.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Modules/_testcapimodule.c Mon Aug 19 20:30:00 2013 +0300 @@ -1649,7 +1649,7 @@ {-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 -r 464eed5ddb2e Modules/mathmodule.c --- a/Modules/mathmodule.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Modules/mathmodule.c Mon Aug 19 20:30:00 2013 +0300 @@ -1535,8 +1535,7 @@ } 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 @@ "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 -r 464eed5ddb2e Modules/socketmodule.c --- a/Modules/socketmodule.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Modules/socketmodule.c Mon Aug 19 20:30:00 2013 +0300 @@ -4654,14 +4654,14 @@ 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 @@ 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)); } diff -r 464eed5ddb2e Objects/abstract.c --- a/Objects/abstract.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Objects/abstract.c Mon Aug 19 20:30:00 2013 +0300 @@ -1154,7 +1154,7 @@ } /* Return a Python Int or Long from the object item - Raise TypeError if the result is not an int-or-long + Raise TypeError if the result is not an int or if the object cannot be interpreted as an index. */ PyObject * @@ -1364,8 +1364,7 @@ /* It should not be possible to get here, as PyNumber_Index already has a check for the same condition */ - PyErr_SetString(PyExc_ValueError, "PyNumber_ToBase: index not " - "int or long"); + PyErr_SetString(PyExc_ValueError, "PyNumber_ToBase: index not int"); Py_DECREF(index); return res; } diff -r 464eed5ddb2e Objects/fileobject.c --- a/Objects/fileobject.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Objects/fileobject.c Mon Aug 19 20:30:00 2013 +0300 @@ -186,9 +186,9 @@ } /* Try to get a file-descriptor from a Python object. If the object - is an integer or long integer, its value is returned. If not, the + is an integer, its value is returned. If not, the object's fileno() method is called if it exists; the method must return - an integer or long integer, which is returned as the file descriptor value. + an integer, which is returned as the file descriptor value. -1 is returned on failure. */ diff -r 464eed5ddb2e Objects/floatobject.c --- a/Objects/floatobject.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Objects/floatobject.c Mon Aug 19 20:30:00 2013 +0300 @@ -227,7 +227,7 @@ /* Macro and helper that convert PyObject obj to a C double and store the value in dbl. If conversion to double raises an exception, obj is set to NULL, and the function invoking this macro returns NULL. If - obj is not of float, int or long type, Py_NotImplemented is incref'ed, + obj is not of float or int type, Py_NotImplemented is incref'ed, stored in obj, and returned from the function invoking this macro. */ #define CONVERT_TO_DOUBLE(obj, dbl) \ @@ -282,7 +282,7 @@ * When mixing float with an integer type, there's no good *uniform* approach. * Converting the double to an integer obviously doesn't work, since we * may lose info from fractional bits. Converting the integer to a double - * also has two failure modes: (1) a long int may trigger overflow (too + * also has two failure modes: (1) an int may trigger overflow (too * large to fit in the dynamic range of a C double); (2) even a C long may have * more bits than fit in a C double (e.g., on a 64-bit box long may have * 63 bits of precision, but a C double probably has only 53), and then @@ -380,7 +380,7 @@ goto Compare; } /* v and w have the same number of bits before the radix - * point. Construct two longs that have the same comparison + * point. Construct two ints that have the same comparison * outcome. */ { @@ -445,7 +445,7 @@ } } /* else if (PyLong_Check(w)) */ - else /* w isn't float, int, or long */ + else /* w isn't float or int */ goto Unimplemented; Compare: diff -r 464eed5ddb2e Objects/longobject.c --- a/Objects/longobject.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Objects/longobject.c Mon Aug 19 20:30:00 2013 +0300 @@ -69,7 +69,7 @@ #define maybe_small_long(val) (val) #endif -/* If a freshly-allocated long is already shared, it must +/* If a freshly-allocated int is already shared, it must be a small integer, so negating it must go to PyLong_FromLong */ Py_LOCAL_INLINE(void) _PyLong_Negate(PyLongObject **x_p) @@ -86,9 +86,9 @@ Py_DECREF(x); } -/* For long multiplication, use the O(N**2) school algorithm unless +/* For int multiplication, use the O(N**2) school algorithm unless * both operands contain more than KARATSUBA_CUTOFF digits (this - * being an internal Python long digit, in base BASE). + * being an internal Python int digit, in base BASE). */ #define KARATSUBA_CUTOFF 70 #define KARATSUBA_SQUARE_CUTOFF (2 * KARATSUBA_CUTOFF) @@ -105,7 +105,7 @@ if (PyErr_CheckSignals()) PyTryBlock \ } while(0) -/* Normalize (remove leading zeros from) a long int object. +/* Normalize (remove leading zeros from) an int object. Doesn't attempt to free the storage--in most cases, due to the nature of the algorithms used, this could save at most be one word anyway. */ @@ -122,7 +122,7 @@ return v; } -/* Allocate a new long int object with size digits. +/* Allocate a new int object with size digits. Return NULL and set exception if we run out of memory. */ #define MAX_LONG_DIGITS \ @@ -174,7 +174,7 @@ return (PyObject *)result; } -/* Create a new long int object from a C long int */ +/* Create a new int object from a C long int */ PyObject * PyLong_FromLong(long ival) @@ -243,7 +243,7 @@ return (PyObject *)v; } -/* Create a new long int object from a C unsigned long int */ +/* Create a new int object from a C unsigned long int */ PyObject * PyLong_FromUnsignedLong(unsigned long ival) @@ -272,7 +272,7 @@ return (PyObject *)v; } -/* Create a new long int object from a C double */ +/* Create a new int object from a C double */ PyObject * PyLong_FromDouble(double dval) @@ -326,7 +326,7 @@ #define PY_ABS_LONG_MIN (0-(unsigned long)LONG_MIN) #define PY_ABS_SSIZE_T_MIN (0-(size_t)PY_SSIZE_T_MIN) -/* Get a C long int from a long int object or any object that has an __int__ +/* Get a C long int from an int object or any object that has an __int__ method. On overflow, return -1 and set *overflow to 1 or -1 depending on the sign of @@ -423,7 +423,7 @@ return res; } -/* Get a C long int from a long int object or any object that has an __int__ +/* Get a C long int from an int object or any object that has an __int__ method. Return -1 and set an error if overflow occurs. */ long @@ -440,7 +440,7 @@ return result; } -/* Get a C int from a long int object or any object that has an __int__ +/* Get a C int from an int object or any object that has an __int__ method. Return -1 and set an error if overflow occurs. */ int @@ -458,7 +458,7 @@ return (int)result; } -/* Get a Py_ssize_t from a long int object. +/* Get a Py_ssize_t from an int object. Returns -1 and sets an error condition if overflow occurs. */ Py_ssize_t @@ -513,7 +513,7 @@ return -1; } -/* Get a C unsigned long int from a long int object. +/* Get a C unsigned long int from an int object. Returns -1 and sets an error condition if overflow occurs. */ unsigned long @@ -557,7 +557,7 @@ return x; } -/* Get a C size_t from a long int object. Returns (size_t)-1 and sets +/* Get a C size_t from an int object. Returns (size_t)-1 and sets an error condition if overflow occurs. */ size_t @@ -600,7 +600,7 @@ return x; } -/* Get a C unsigned long int from a long int object, ignoring the high bits. +/* Get a C unsigned long int from an int object, ignoring the high bits. Returns -1 and sets an error condition if an error occurs. */ static unsigned long @@ -718,7 +718,7 @@ int incr; /* direction to move pstartbyte */ const unsigned char* pendbyte; /* MSB of bytes */ size_t numsignificantbytes; /* number of bytes that matter */ - Py_ssize_t ndigits; /* number of Python long digits */ + Py_ssize_t ndigits; /* number of Python int digits */ PyLongObject* v; /* result */ Py_ssize_t idigit = 0; /* next free index in v->ob_digit */ @@ -762,8 +762,8 @@ ++numsignificantbytes; } - /* How many Python long digits do we need? We have - 8*numsignificantbytes bits, and each Python long digit has + /* How many Python int digits do we need? We have + 8*numsignificantbytes bits, and each Python int digit has PyLong_SHIFT bits, so it's the ceiling of the quotient. */ /* catch overflow before it happens */ if (numsignificantbytes > (PY_SSIZE_T_MAX - PyLong_SHIFT) / 8) { @@ -863,7 +863,7 @@ /* Copy over all the Python digits. It's crucial that every Python digit except for the MSD contribute - exactly PyLong_SHIFT bits to the total, so first assert that the long is + exactly PyLong_SHIFT bits to the total, so first assert that the int is normalized. */ assert(ndigits == 0 || v->ob_digit[ndigits - 1] != 0); j = 0; @@ -918,7 +918,7 @@ ++j; if (do_twos_comp) { /* Fill leading bits of the byte with sign bits - (appropriately pretending that the long had an + (appropriately pretending that the int had an infinite supply of sign bits). */ accum |= (~(twodigits)0) << accumbits; } @@ -954,7 +954,7 @@ } -/* Create a new long int object from a C pointer */ +/* Create a new int object from a C pointer */ PyObject * PyLong_FromVoidPtr(void *p) @@ -974,7 +974,7 @@ } -/* Get a C pointer from a long int object. */ +/* Get a C pointer from an int object. */ void * PyLong_AsVoidPtr(PyObject *vv) @@ -1016,7 +1016,7 @@ #define PY_ABS_LLONG_MIN (0-(unsigned PY_LONG_LONG)PY_LLONG_MIN) -/* Create a new long int object from a C PY_LONG_LONG int. */ +/* Create a new int object from a C PY_LONG_LONG int. */ PyObject * PyLong_FromLongLong(PY_LONG_LONG ival) @@ -1060,7 +1060,7 @@ return (PyObject *)v; } -/* Create a new long int object from a C unsigned PY_LONG_LONG int. */ +/* Create a new int object from a C unsigned PY_LONG_LONG int. */ PyObject * PyLong_FromUnsignedLongLong(unsigned PY_LONG_LONG ival) @@ -1089,7 +1089,7 @@ return (PyObject *)v; } -/* Create a new long int object from a C Py_ssize_t. */ +/* Create a new int object from a C Py_ssize_t. */ PyObject * PyLong_FromSsize_t(Py_ssize_t ival) @@ -1129,7 +1129,7 @@ return (PyObject *)v; } -/* Create a new long int object from a C size_t. */ +/* Create a new int object from a C size_t. */ PyObject * PyLong_FromSize_t(size_t ival) @@ -1158,7 +1158,7 @@ return (PyObject *)v; } -/* Get a C long long int from a long int object or any object that has an +/* Get a C long long int from an int object or any object that has an __int__ method. Return -1 and set an error if overflow occurs. */ PY_LONG_LONG @@ -1209,7 +1209,7 @@ return bytes; } -/* Get a C unsigned PY_LONG_LONG int from a long int object. +/* Get a C unsigned PY_LONG_LONG int from an int object. Return -1 and set an error if overflow occurs. */ unsigned PY_LONG_LONG @@ -1244,7 +1244,7 @@ return bytes; } -/* Get a C unsigned long int from a long int object, ignoring the high bits. +/* Get a C unsigned long int from an int object, ignoring the high bits. Returns -1 and sets an error condition if an error occurs. */ static unsigned PY_LONG_LONG @@ -1312,7 +1312,7 @@ } } -/* Get a C long long int from a long int object or any object that has an +/* Get a C long long int from an int object or any object that has an __int__ method. On overflow, return -1 and set *overflow to 1 or -1 depending on the sign of @@ -1529,7 +1529,7 @@ /* Divide long pin, w/ size digits, by non-zero digit n, storing quotient in pout, and returning the remainder. pin and pout point at the LSD. It's OK for pin == pout on entry, which saves oodles of mallocs/frees in - _PyLong_Format, but that should be done with great care since longs are + _PyLong_Format, but that should be done with great care since ints are immutable. */ static digit @@ -1549,7 +1549,7 @@ return (digit)rem; } -/* Divide a long integer by a digit, returning both the quotient +/* Divide an integer by a digit, returning both the quotient (as function result) and the remainder (through *prem). The sign of a is ignored; n should not be zero. */ @@ -1567,7 +1567,7 @@ return long_normalize(z); } -/* Convert a long integer to a base 10 string. Returns a new non-shared +/* Convert an integer to a base 10 string. Returns a new non-shared string. (Return value is non-shared so that callers can modify the returned value if necessary.) */ @@ -1735,7 +1735,7 @@ return v; } -/* Convert a long int object to a string, using a given conversion base, +/* Convert an int object to a string, using a given conversion base, which should be one of 2, 8 or 16. Return a string object. If base is 2, 8 or 16, add the proper prefix '0b', '0o' or '0x' if alternate is nonzero. */ @@ -1936,7 +1936,7 @@ /* *str points to the first digit in a string of base `base` digits. base * is a power of 2 (2, 4, 8, 16, or 32). *str is set to point to the first - * non-digit (which may be *str!). A normalized long is returned. + * non-digit (which may be *str!). A normalized int is returned. * The point to this routine is that it takes time linear in the number of * string characters. */ @@ -1971,7 +1971,7 @@ z = _PyLong_New(n); if (z == NULL) return NULL; - /* Read string from right, and fill in long from left; i.e., + /* Read string from right, and fill in int from left; i.e., * from least to most significant in both. */ accum = 0; @@ -2000,7 +2000,7 @@ return long_normalize(z); } -/* Parses a long from a bytestring. Leading and trailing whitespace will be +/* Parses an int from a bytestring. Leading and trailing whitespace will be * ignored. * * If successful, a PyLong object will be returned and 'pend' will be pointing @@ -2070,7 +2070,7 @@ n >= log(B**N)/log(BASE) = N * log(B)/log(BASE) The static array log_base_BASE[base] == log(base)/log(BASE) so we can compute -this quickly. A Python long with that much space is reserved near the start, +this quickly. A Python int with that much space is reserved near the start, and the result is computed into it. The input string is actually treated as being in base base**i (i.e., i digits @@ -2135,7 +2135,7 @@ rounding errors could kill us. Finding worst cases in IEEE double-precision requires better-than-double-precision log() functions, and Tim didn't bother. Instead the code checks to see whether the allocated space is enough as each -new Python digit is added, and copies the whole thing to a larger long if not. +new Python digit is added, and copies the whole thing to a larger int if not. This should happen extremely rarely, and in fact I don't have a test case that triggers it(!). Instead the code was tested by artificially allocating just 1 digit at the start, so that the copying code was exercised for every @@ -2176,7 +2176,7 @@ while (_PyLong_DigitValue[Py_CHARMASK(*scan)] < base) ++scan; - /* Create a long object that can contain the largest possible + /* Create an int object that can contain the largest possible * integer with this base and length. Note that there's no * need to initialize z->ob_digit -- no slot is read up before * being stored into. @@ -2429,7 +2429,7 @@ return 0; } -/* Unsigned long division with remainder -- the algorithm. The arguments v1 +/* Unsigned int division with remainder -- the algorithm. The arguments v1 and w1 should satisfy 2 <= ABS(Py_SIZE(w1)) <= ABS(Py_SIZE(v1)). */ static PyLongObject * @@ -2680,7 +2680,7 @@ return -1.0; } -/* Get a C double from a long int object. Rounds to the nearest double, +/* Get a C double from an int object. Rounds to the nearest double, using the round-half-to-even rule in the case of a tie. */ double @@ -2836,7 +2836,7 @@ } -/* Add the absolute values of two long integers. */ +/* Add the absolute values of two integers. */ static PyLongObject * x_add(PyLongObject *a, PyLongObject *b) @@ -3047,7 +3047,7 @@ assert((carry >> PyLong_SHIFT) == 0); } } - else { /* a is not the same as b -- gradeschool long mult */ + else { /* a is not the same as b -- gradeschool int mult */ for (i = 0; i < size_a; ++i) { twodigits carry = 0; twodigits f = a->ob_digit[i]; @@ -3075,7 +3075,7 @@ } /* A helper for Karatsuba multiplication (k_mul). - Takes a long "n" and an integer "size" representing the place to + Takes an int "n" and an integer "size" representing the place to split, and sets low and high such that abs(n) == (high << size) + low, viewing the shift as being by digits. The sign bit is ignored, and the return values are >= 0. @@ -4375,10 +4375,10 @@ } } -/* Wimpy, slow approach to tp_new calls for subtypes of long: - first create a regular long from whatever arguments we got, +/* Wimpy, slow approach to tp_new calls for subtypes of int: + first create a regular int from whatever arguments we got, then allocate a subtype instance and initialize it from - the regular long. The regular long is then thrown away. + the regular int. The regular int is then thrown away. */ static PyObject * long_subtype_new(PyTypeObject *type, PyObject *args, PyObject *kwds) @@ -4829,7 +4829,7 @@ Py_DECREF(bytes); /* If from_bytes() was used on subclass, allocate new subclass - * instance, initialize it with decoded long value and return it. + * instance, initialize it with decoded int value and return it. */ if (type != &PyLong_Type && PyType_IsSubtype(type, &PyLong_Type)) { PyLongObject *newobj; diff -r 464eed5ddb2e Objects/rangeobject.c --- a/Objects/rangeobject.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Objects/rangeobject.c Mon Aug 19 20:30:00 2013 +0300 @@ -740,7 +740,7 @@ /*********************** range Iterator **************************/ /* There are 2 types of iterators, one for C longs, the other for - Python longs (ie, PyObjects). This should make iteration fast + Python ints (ie, PyObjects). This should make iteration fast in the normal case, but possible for any numeric value. */ diff -r 464eed5ddb2e PC/pyconfig.h --- a/PC/pyconfig.h Mon Aug 19 10:03:11 2013 +0300 +++ b/PC/pyconfig.h Mon Aug 19 20:30:00 2013 +0300 @@ -394,7 +394,7 @@ #endif /* define signed and unsigned exact-width 32-bit and 64-bit types, used in the - implementation of Python long integers. */ + implementation of Python integers. */ #ifndef PY_UINT32_T #if SIZEOF_INT == 4 #define HAVE_UINT32_T 1 diff -r 464eed5ddb2e PC/winreg.c --- a/PC/winreg.c Mon Aug 19 10:03:11 2013 +0300 +++ b/PC/winreg.c Mon Aug 19 20:30:00 2013 +0300 @@ -253,7 +253,7 @@ "The result is a tuple of 3 items:" "An integer that identifies the number of sub keys this key has.\n" "An integer that identifies the number of values this key has.\n" -"A long integer that identifies when the key was last modified (if available)\n" +"An integer that identifies when the key was last modified (if available)\n" " as 100's of nanoseconds since Jan 1, 1600."); PyDoc_STRVAR(QueryValue_doc, @@ -406,7 +406,7 @@ "but the handle is not closed. You would call this function when you\n" "need the underlying win32 handle to exist beyond the lifetime of the\n" "handle object.\n" -"On 64 bit windows, the result of this function is a long integer"); +"On 64 bit windows, the result of this function is an integer"); /************************************************************************ diff -r 464eed5ddb2e Python/bltinmodule.c --- a/Python/bltinmodule.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Python/bltinmodule.c Mon Aug 19 20:30:00 2013 +0300 @@ -1531,7 +1531,7 @@ "pow(x, y[, z]) -> number\n\ \n\ With two arguments, equivalent to x**y. With three arguments,\n\ -equivalent to (x**y) % z, but may be more efficient (e.g. for longs)."); +equivalent to (x**y) % z, but may be more efficient (e.g. for ints)."); diff -r 464eed5ddb2e Python/compile.c --- a/Python/compile.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Python/compile.c Mon Aug 19 20:30:00 2013 +0300 @@ -1043,7 +1043,7 @@ Py_ssize_t arg; double d; - /* necessary to make sure types aren't coerced (e.g., int and long) */ + /* necessary to make sure types aren't coerced (e.g., float and complex) */ /* _and_ to distinguish 0.0 from -0.0 e.g. on IEEE platforms */ if (PyFloat_Check(o)) { d = PyFloat_AS_DOUBLE(o); diff -r 464eed5ddb2e Python/formatter_unicode.c --- a/Python/formatter_unicode.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Python/formatter_unicode.c Mon Aug 19 20:30:00 2013 +0300 @@ -1442,7 +1442,7 @@ case 'x': case 'X': case 'n': - /* no type conversion needed, already an int (or long). do + /* no type conversion needed, already an int. do the formatting */ result = format_long_internal(obj, &format, writer); break; diff -r 464eed5ddb2e Python/marshal.c --- a/Python/marshal.c Mon Aug 19 10:03:11 2013 +0300 +++ b/Python/marshal.c Mon Aug 19 20:30:00 2013 +0300 @@ -148,7 +148,7 @@ w_string(s, n, p); } -/* We assume that Python longs are stored internally in base some power of +/* We assume that Python ints are stored internally in base some power of 2**15; for the sake of portability we'll always read and write them in base exactly 2**15. */ @@ -505,7 +505,7 @@ } } -/* version currently has no effect for writing longs. */ +/* version currently has no effect for writing ints. */ void PyMarshal_WriteLongToFile(long x, FILE *fp, int version) {