diff options
author | Guido van Rossum <guido@python.org> | 2007-01-15 16:59:06 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-01-15 16:59:06 (GMT) |
commit | e2a383d062434c05b73031f0da57fe82b9da8942 (patch) | |
tree | 1a6fb6b2c056a10ee227dbc75855b3fac6153414 | |
parent | fc7bb8c786fd9cb3b1ab84e1976620d0ab545777 (diff) | |
download | cpython-e2a383d062434c05b73031f0da57fe82b9da8942.zip cpython-e2a383d062434c05b73031f0da57fe82b9da8942.tar.gz cpython-e2a383d062434c05b73031f0da57fe82b9da8942.tar.bz2 |
Rip out 'long' and 'L'-suffixed integer literals.
(Rough first cut.)
146 files changed, 1443 insertions, 1474 deletions
diff --git a/Lib/BaseHTTPServer.py b/Lib/BaseHTTPServer.py index e4e1a14..ae916b6 100644 --- a/Lib/BaseHTTPServer.py +++ b/Lib/BaseHTTPServer.py @@ -331,12 +331,12 @@ class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler): """ try: - short, long = self.responses[code] + shortmsg, longmsg = self.responses[code] except KeyError: - short, long = '???', '???' + shortmsg, longmsg = '???', '???' if message is None: - message = short - explain = long + message = shortmsg + explain = longmsg self.log_error("code %d, message %s", code, message) # using _quote_html to prevent Cross Site Scripting attacks (see bug #1100201) content = (self.error_message_format % diff --git a/Lib/UserString.py b/Lib/UserString.py index 271026c..62e73bb 100755 --- a/Lib/UserString.py +++ b/Lib/UserString.py @@ -20,7 +20,7 @@ class UserString: def __str__(self): return str(self.data) def __repr__(self): return repr(self.data) def __int__(self): return int(self.data) - def __long__(self): return long(self.data) + def __long__(self): return int(self.data) def __float__(self): return float(self.data) def __complex__(self): return complex(self.data) def __hash__(self): return hash(self.data) diff --git a/Lib/aifc.py b/Lib/aifc.py index a5f86be..e28c5c0 100644 --- a/Lib/aifc.py +++ b/Lib/aifc.py @@ -142,7 +142,7 @@ __all__ = ["Error","open","openfp"] class Error(Exception): pass -_AIFC_version = 0xA2805140L # Version 1 of AIFF-C +_AIFC_version = 0xA2805140 # Version 1 of AIFF-C _skiplist = 'COMT', 'INST', 'MIDI', 'AESD', \ 'APPL', 'NAME', 'AUTH', '(c) ', 'ANNO' @@ -191,7 +191,7 @@ def _read_float(f): # 10 bytes f = _HUGE_VAL else: expon = expon - 16383 - f = (himant * 0x100000000L + lomant) * pow(2.0, expon - 63) + f = (himant * 0x100000000 + lomant) * pow(2.0, expon - 63) return sign * f def _write_short(f, x): @@ -233,10 +233,10 @@ def _write_float(f, x): expon = expon | sign fmant = math.ldexp(fmant, 32) fsmant = math.floor(fmant) - himant = long(fsmant) + himant = int(fsmant) fmant = math.ldexp(fmant - fsmant, 32) fsmant = math.floor(fmant) - lomant = long(fsmant) + lomant = int(fsmant) _write_short(f, expon) _write_long(f, himant) _write_long(f, lomant) diff --git a/Lib/asynchat.py b/Lib/asynchat.py index 1ad3161..dc7f10f 100644 --- a/Lib/asynchat.py +++ b/Lib/asynchat.py @@ -105,7 +105,7 @@ class async_chat (asyncore.dispatcher): # no terminator, collect it all self.collect_incoming_data (self.ac_in_buffer) self.ac_in_buffer = '' - elif isinstance(terminator, int) or isinstance(terminator, long): + elif isinstance(terminator, int) or isinstance(terminator, int): # numeric terminator n = terminator if lb < n: diff --git a/Lib/base64.py b/Lib/base64.py index 009f9f6..dbcccd8 100755 --- a/Lib/base64.py +++ b/Lib/base64.py @@ -129,7 +129,7 @@ _b32alphabet = { _b32tab = _b32alphabet.items() _b32tab.sort() _b32tab = [v for k, v in _b32tab] -_b32rev = dict([(v, long(k)) for k, v in _b32alphabet.items()]) +_b32rev = dict([(v, int(k)) for k, v in _b32alphabet.items()]) def b32encode(s): diff --git a/Lib/copy.py b/Lib/copy.py index f9e403d..527759f 100644 --- a/Lib/copy.py +++ b/Lib/copy.py @@ -99,7 +99,7 @@ _copy_dispatch = d = {} def _copy_immutable(x): return x -for t in (type(None), int, long, float, bool, str, tuple, +for t in (type(None), int, int, float, bool, str, tuple, frozenset, type, xrange, types.ClassType, types.BuiltinFunctionType, types.FunctionType): @@ -178,7 +178,7 @@ def _deepcopy_atomic(x, memo): return x d[type(None)] = _deepcopy_atomic d[int] = _deepcopy_atomic -d[long] = _deepcopy_atomic +d[int] = _deepcopy_atomic d[float] = _deepcopy_atomic d[bool] = _deepcopy_atomic try: @@ -315,7 +315,7 @@ class _EmptyClass: pass def _test(): - l = [None, 1, 2L, 3.14, 'xyzzy', (1, 2L), [3.14, 'abc'], + l = [None, 1, 2, 3.14, 'xyzzy', (1, 2), [3.14, 'abc'], {'abc': 'ABC'}, (), [], {}] l1 = copy(l) print l1==l @@ -369,7 +369,7 @@ class Sniffer: for col in columnTypes.keys(): - for thisType in [int, long, float, complex]: + for thisType in [int, int, float, complex]: try: thisType(row[col]) break @@ -380,7 +380,7 @@ class Sniffer: thisType = len(row[col]) # treat longs as ints - if thisType == long: + if thisType == int: thisType = int if thisType != columnTypes[col]: diff --git a/Lib/ctypes/__init__.py b/Lib/ctypes/__init__.py index efb0c5c..e2ea426 100644 --- a/Lib/ctypes/__init__.py +++ b/Lib/ctypes/__init__.py @@ -66,7 +66,7 @@ def create_string_buffer(init, size=None): buf = buftype() buf.value = init return buf - elif isinstance(init, (int, long)): + elif isinstance(init, (int, int)): buftype = c_char * init buf = buftype() return buf @@ -285,7 +285,7 @@ else: buf = buftype() buf.value = init return buf - elif isinstance(init, (int, long)): + elif isinstance(init, (int, int)): buftype = c_wchar * init buf = buftype() return buf @@ -356,7 +356,7 @@ class CDLL(object): def __getitem__(self, name_or_ordinal): func = self._FuncPtr((name_or_ordinal, self)) - if not isinstance(name_or_ordinal, (int, long)): + if not isinstance(name_or_ordinal, (int, int)): func.__name__ = name_or_ordinal return func diff --git a/Lib/ctypes/test/test_as_parameter.py b/Lib/ctypes/test/test_as_parameter.py index 0581059..4a33332 100644 --- a/Lib/ctypes/test/test_as_parameter.py +++ b/Lib/ctypes/test/test_as_parameter.py @@ -133,7 +133,7 @@ class BasicWrapTestCase(unittest.TestCase): f.argtypes = [c_longlong, MyCallback] def callback(value): - self.failUnless(isinstance(value, (int, long))) + self.failUnless(isinstance(value, (int, int))) return value & 0x7FFFFFFF cb = MyCallback(callback) diff --git a/Lib/ctypes/test/test_functions.py b/Lib/ctypes/test/test_functions.py index 759aea7..e907e21 100644 --- a/Lib/ctypes/test/test_functions.py +++ b/Lib/ctypes/test/test_functions.py @@ -291,7 +291,7 @@ class FunctionTestCase(unittest.TestCase): f.argtypes = [c_longlong, MyCallback] def callback(value): - self.failUnless(isinstance(value, (int, long))) + self.failUnless(isinstance(value, (int, int))) return value & 0x7FFFFFFF cb = MyCallback(callback) diff --git a/Lib/ctypes/test/test_numbers.py b/Lib/ctypes/test/test_numbers.py index c22688d..d4f2238 100644 --- a/Lib/ctypes/test/test_numbers.py +++ b/Lib/ctypes/test/test_numbers.py @@ -93,7 +93,7 @@ class NumberTestCase(unittest.TestCase): for t in float_types: self.failUnlessEqual(t(2.0).value, 2.0) self.failUnlessEqual(t(2).value, 2.0) - self.failUnlessEqual(t(2L).value, 2.0) + self.failUnlessEqual(t(2).value, 2.0) def test_integers(self): # integers cannot be constructed from floats diff --git a/Lib/ctypes/test/test_pointers.py b/Lib/ctypes/test/test_pointers.py index 586655a..df62d04 100644 --- a/Lib/ctypes/test/test_pointers.py +++ b/Lib/ctypes/test/test_pointers.py @@ -5,8 +5,8 @@ import _ctypes_test ctype_types = [c_byte, c_ubyte, c_short, c_ushort, c_int, c_uint, c_long, c_ulong, c_longlong, c_ulonglong, c_double, c_float] -python_types = [int, int, int, int, int, long, - int, long, long, long, float, float] +python_types = [int, int, int, int, int, int, + int, int, int, int, float, float] class PointersTestCase(unittest.TestCase): @@ -160,16 +160,16 @@ class PointersTestCase(unittest.TestCase): def test_c_void_p(self): # http://sourceforge.net/tracker/?func=detail&aid=1518190&group_id=5470&atid=105470 if sizeof(c_void_p) == 4: - self.failUnlessEqual(c_void_p(0xFFFFFFFFL).value, + self.failUnlessEqual(c_void_p(0xFFFFFFFF).value, c_void_p(-1).value) - self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFL).value, + self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFF).value, c_void_p(-1).value) elif sizeof(c_void_p) == 8: - self.failUnlessEqual(c_void_p(0xFFFFFFFFL).value, - 0xFFFFFFFFL) - self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFL).value, + self.failUnlessEqual(c_void_p(0xFFFFFFFF).value, + 0xFFFFFFFF) + self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFF).value, c_void_p(-1).value) - self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFFFFFFFFFL).value, + self.failUnlessEqual(c_void_p(0xFFFFFFFFFFFFFFFFFFFFFFFF).value, c_void_p(-1).value) self.assertRaises(TypeError, c_void_p, 3.14) # make sure floats are NOT accepted diff --git a/Lib/ctypes/test/test_prototypes.py b/Lib/ctypes/test/test_prototypes.py index 9f02086..56ddf4a 100644 --- a/Lib/ctypes/test/test_prototypes.py +++ b/Lib/ctypes/test/test_prototypes.py @@ -33,7 +33,7 @@ def positive_address(a): # View the bits in `a` as unsigned instead. import struct num_bits = struct.calcsize("P") * 8 # num bits in native machine address - a += 1L << num_bits + a += 1 << num_bits assert a >= 0 return a diff --git a/Lib/decimal.py b/Lib/decimal.py index 86455f3..f70e374 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -545,7 +545,7 @@ class Decimal(object): return self # From an integer - if isinstance(value, (int,long)): + if isinstance(value, (int,int)): if value >= 0: self._sign = 0 else: @@ -561,7 +561,7 @@ class Decimal(object): if value[0] not in (0,1): raise ValueError, 'Invalid sign' for digit in value[1]: - if not isinstance(digit, (int,long)) or digit < 0: + if not isinstance(digit, (int,int)) or digit < 0: raise ValueError, "The second value in the tuple must be composed of non negative integer elements." self._sign = value[0] @@ -740,32 +740,32 @@ class Decimal(object): return 1 def __eq__(self, other): - if not isinstance(other, (Decimal, int, long)): + if not isinstance(other, (Decimal, int, int)): return NotImplemented return self.__cmp__(other) == 0 def __ne__(self, other): - if not isinstance(other, (Decimal, int, long)): + if not isinstance(other, (Decimal, int, int)): return NotImplemented return self.__cmp__(other) != 0 def __lt__(self, other): - if not isinstance(other, (Decimal, int, long)): + if not isinstance(other, (Decimal, int, int)): return NotImplemented return self.__cmp__(other) < 0 def __le__(self, other): - if not isinstance(other, (Decimal, int, long)): + if not isinstance(other, (Decimal, int, int)): return NotImplemented return self.__cmp__(other) <= 0 def __gt__(self, other): - if not isinstance(other, (Decimal, int, long)): + if not isinstance(other, (Decimal, int, int)): return NotImplemented return self.__cmp__(other) > 0 def __ge__(self, other): - if not isinstance(other, (Decimal, int, long)): + if not isinstance(other, (Decimal, int, int)): return NotImplemented return self.__cmp__(other) >= 0 @@ -1529,7 +1529,7 @@ class Decimal(object): Equivalent to long(int(self)) """ - return long(self.__int__()) + return int(self.__int__()) def _fix(self, context): """Round if it is necessary to keep self within prec precision. @@ -2986,7 +2986,7 @@ def _convert_other(other): """ if isinstance(other, Decimal): return other - if isinstance(other, (int, long)): + if isinstance(other, (int, int)): return Decimal(other) return NotImplemented @@ -86,7 +86,7 @@ def disassemble(co, lasti=-1): extended_arg = 0 i = i+2 if op == EXTENDED_ARG: - extended_arg = oparg*65536L + extended_arg = oparg*65536 print repr(oparg).rjust(5), if op in hasconst: print '(' + repr(co.co_consts[oparg]) + ')', diff --git a/Lib/email/test/test_email_codecs.py b/Lib/email/test/test_email_codecs.py index 38b7d95..8b97530 100644 --- a/Lib/email/test/test_email_codecs.py +++ b/Lib/email/test/test_email_codecs.py @@ -41,8 +41,8 @@ Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?= [('Hello World!', None), ('\x1b$B%O%m!<%o!<%k%I!*\x1b(B', 'iso-2022-jp'), ('Gr\xfc\xdf Gott!', 'iso-8859-1')]) - long = 'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9' - h = Header(long, j, header_name="Subject") + int = 'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9' + h = Header(int, j, header_name="Subject") # test a very long header enc = h.encode() # TK: splitting point may differ by codec design and/or Header encoding @@ -50,7 +50,7 @@ Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?= =?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYSE8JWskTztKGyhC?= =?iso-2022-jp?b?GyRCMnE8VCROPjVHJyRyQlQkQyRGJCQkXiQ5GyhC?=""") # TK: full decode comparison - eq(h.__unicode__().encode('euc-jp'), long) + eq(h.__unicode__().encode('euc-jp'), int) def test_payload_encoding(self): jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa' diff --git a/Lib/email/test/test_email_codecs_renamed.py b/Lib/email/test/test_email_codecs_renamed.py index 56baccd..10e2065 100644 --- a/Lib/email/test/test_email_codecs_renamed.py +++ b/Lib/email/test/test_email_codecs_renamed.py @@ -41,8 +41,8 @@ Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?= [('Hello World!', None), ('\x1b$B%O%m!<%o!<%k%I!*\x1b(B', 'iso-2022-jp'), ('Gr\xfc\xdf Gott!', 'iso-8859-1')]) - long = 'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9' - h = Header(long, j, header_name="Subject") + int = 'test-ja \xa4\xd8\xc5\xea\xb9\xc6\xa4\xb5\xa4\xec\xa4\xbf\xa5\xe1\xa1\xbc\xa5\xeb\xa4\xcf\xbb\xca\xb2\xf1\xbc\xd4\xa4\xce\xbe\xb5\xc7\xa7\xa4\xf2\xc2\xd4\xa4\xc3\xa4\xc6\xa4\xa4\xa4\xde\xa4\xb9' + h = Header(int, j, header_name="Subject") # test a very long header enc = h.encode() # TK: splitting point may differ by codec design and/or Header encoding @@ -50,7 +50,7 @@ Hello World! =?iso-2022-jp?b?GyRCJU8lbSE8JW8hPCVrJUkhKhsoQg==?= =?iso-2022-jp?b?dGVzdC1qYSAbJEIkWEVqOUYkNSRsJD8lYSE8JWskTztKGyhC?= =?iso-2022-jp?b?GyRCMnE8VCROPjVHJyRyQlQkQyRGJCQkXiQ5GyhC?=""") # TK: full decode comparison - eq(h.__unicode__().encode('euc-jp'), long) + eq(h.__unicode__().encode('euc-jp'), int) def test_payload_encoding(self): jhello = '\xa5\xcf\xa5\xed\xa1\xbc\xa5\xef\xa1\xbc\xa5\xeb\xa5\xc9\xa1\xaa' diff --git a/Lib/ftplib.py b/Lib/ftplib.py index 94ff2cd..23ccd88 100644 --- a/Lib/ftplib.py +++ b/Lib/ftplib.py @@ -514,7 +514,7 @@ class FTP: try: return int(s) except (OverflowError, ValueError): - return long(s) + return int(s) def mkd(self, dirname): '''Make a directory, return its full pathname.''' @@ -564,7 +564,7 @@ def parse150(resp): try: return int(s) except (OverflowError, ValueError): - return long(s) + return int(s) _227_re = None diff --git a/Lib/gettext.py b/Lib/gettext.py index 90ebc51..a1975e8 100644 --- a/Lib/gettext.py +++ b/Lib/gettext.py @@ -256,8 +256,8 @@ class NullTranslations: class GNUTranslations(NullTranslations): # Magic number of .mo files - LE_MAGIC = 0x950412deL - BE_MAGIC = 0xde120495L + LE_MAGIC = 0x950412de + BE_MAGIC = 0xde120495 def _parse(self, fp): """Override this method to support alternative .mo formats.""" diff --git a/Lib/gzip.py b/Lib/gzip.py index c37d5a1..e5bb79e 100644 --- a/Lib/gzip.py +++ b/Lib/gzip.py @@ -21,12 +21,12 @@ def U32(i): If it's >= 2GB when viewed as a 32-bit unsigned int, return a long. """ if i < 0: - i += 1L << 32 + i += 1 << 32 return i def LOWU32(i): """Return the low-order 32 bits of an int, as a non-negative int.""" - return i & 0xFFFFFFFFL + return i & 0xFFFFFFFF def write32(output, value): output.write(struct.pack("<l", value)) @@ -148,7 +148,7 @@ class GzipFile: if fname: flags = FNAME self.fileobj.write(chr(flags)) - write32u(self.fileobj, long(time.time())) + write32u(self.fileobj, int(time.time())) self.fileobj.write('\002') self.fileobj.write('\377') if fname: diff --git a/Lib/imputil.py b/Lib/imputil.py index f2e752c..c3d1acd 100644 --- a/Lib/imputil.py +++ b/Lib/imputil.py @@ -500,7 +500,7 @@ def _timestamp(pathname): s = _os_stat(pathname) except OSError: return None - return long(s.st_mtime) + return int(s.st_mtime) ###################################################################### @@ -583,7 +583,7 @@ class _FilesystemImporter(Importer): def py_suffix_importer(filename, finfo, fqname): file = filename[:-3] + _suffix - t_py = long(finfo[8]) + t_py = int(finfo[8]) t_pyc = _timestamp(file) code = None diff --git a/Lib/logging/__init__.py b/Lib/logging/__init__.py index 1415226..220ff09 100644 --- a/Lib/logging/__init__.py +++ b/Lib/logging/__init__.py @@ -251,7 +251,7 @@ class LogRecord: self.lineno = lineno self.funcName = func self.created = ct - self.msecs = (ct - long(ct)) * 1000 + self.msecs = (ct - int(ct)) * 1000 self.relativeCreated = (self.created - _startTime) * 1000 if logThreads and thread: self.thread = thread.get_ident() diff --git a/Lib/mailbox.py b/Lib/mailbox.py index 2293a6c..d55a3dd 100755 --- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -2043,7 +2043,7 @@ class MHMailbox: # list = map(long, filter(pat.match, os.listdir(self.dirname))) list = os.listdir(self.dirname) list = filter(pat.match, list) - list = map(long, list) + list = map(int, list) list.sort() # This only works in Python 1.6 or later; # before that str() added 'L': diff --git a/Lib/msilib/__init__.py b/Lib/msilib/__init__.py index b14bc32..269a2fa 100644 --- a/Lib/msilib/__init__.py +++ b/Lib/msilib/__init__.py @@ -99,7 +99,7 @@ def add_data(db, table, values): assert len(value) == count, value for i in range(count): field = value[i] - if isinstance(field, (int, long)): + if isinstance(field, (int, int)): r.SetInteger(i+1,field) elif isinstance(field, basestring): r.SetString(i+1,field) diff --git a/Lib/optparse.py b/Lib/optparse.py index e1c675a..eca2818 100644 --- a/Lib/optparse.py +++ b/Lib/optparse.py @@ -407,7 +407,7 @@ def _parse_int(val): return _parse_num(val, int) def _parse_long(val): - return _parse_num(val, long) + return _parse_num(val, int) _builtin_cvt = { "int" : (_parse_int, _("integer")), "long" : (_parse_long, _("long integer")), diff --git a/Lib/pickle.py b/Lib/pickle.py index 85c79d3..b828e16 100644 --- a/Lib/pickle.py +++ b/Lib/pickle.py @@ -898,7 +898,7 @@ class Unpickler: try: val = int(data) except ValueError: - val = long(data) + val = int(data) self.append(val) dispatch[INT] = load_int @@ -915,7 +915,7 @@ class Unpickler: dispatch[BININT2] = load_binint2 def load_long(self): - self.append(long(self.readline()[:-1], 0)) + self.append(int(self.readline()[:-1], 0)) dispatch[LONG] = load_long def load_long1(self): @@ -1239,22 +1239,22 @@ import binascii as _binascii def encode_long(x): r"""Encode a long to a two's complement little-endian binary string. - Note that 0L is a special case, returning an empty string, to save a + Note that 0 is a special case, returning an empty string, to save a byte in the LONG1 pickling context. - >>> encode_long(0L) + >>> encode_long(0) '' - >>> encode_long(255L) + >>> encode_long(255) '\xff\x00' - >>> encode_long(32767L) + >>> encode_long(32767) '\xff\x7f' - >>> encode_long(-256L) + >>> encode_long(-256) '\x00\xff' - >>> encode_long(-32768L) + >>> encode_long(-32768) '\x00\x80' - >>> encode_long(-128L) + >>> encode_long(-128) '\x80' - >>> encode_long(127L) + >>> encode_long(127) '\x7f' >>> """ @@ -1284,7 +1284,7 @@ def encode_long(x): # Extend to a full byte. nibbles += 1 nbits = nibbles * 4 - x += 1L << nbits + x += 1 << nbits assert x > 0 ashex = hex(x) njunkchars = 2 + ashex.endswith('L') @@ -1324,11 +1324,11 @@ def decode_long(data): nbytes = len(data) if nbytes == 0: - return 0L + return 0 ashex = _binascii.hexlify(data[::-1]) - n = long(ashex, 16) # quadratic time before Python 2.3; linear now + n = int(ashex, 16) # quadratic time before Python 2.3; linear now if data[-1] >= '\x80': - n -= 1L << (nbytes * 8) + n -= 1 << (nbytes * 8) return n # Shorthands diff --git a/Lib/pickletools.py b/Lib/pickletools.py index 6757b59..8b255b9 100644 --- a/Lib/pickletools.py +++ b/Lib/pickletools.py @@ -511,7 +511,7 @@ def read_decimalnl_short(f): try: return int(s) except OverflowError: - return long(s) + return int(s) def read_decimalnl_long(f): r""" @@ -525,7 +525,7 @@ def read_decimalnl_long(f): """ s = read_stringnl(f, decode=False, stripquotes=False) - return long(s) + return int(s) decimalnl_short = ArgumentDescriptor( @@ -676,7 +676,7 @@ long4 = ArgumentDescriptor( This first reads four bytes as a signed size (but requires the size to be >= 0), then reads that many bytes and interprets them as a little-endian 2's-complement long. If the size is 0, that's taken - as a shortcut for the long 0L, although LONG1 should really be used + as a shortcut for the int 0, although LONG1 should really be used then instead (and in any case where # of bytes < 256). """) @@ -724,12 +724,12 @@ pyint = StackObject( pylong = StackObject( name='long', - obtype=long, + obtype=int, doc="A long (as opposed to short) Python integer object.") pyinteger_or_bool = StackObject( name='int_or_bool', - obtype=(int, long, bool), + obtype=(int, int, bool), doc="A Python integer object (short or long), or " "a Python bool.") diff --git a/Lib/plat-aix3/IN.py b/Lib/plat-aix3/IN.py index 2c57362..8b0989e 100644 --- a/Lib/plat-aix3/IN.py +++ b/Lib/plat-aix3/IN.py @@ -86,30 +86,30 @@ IPPROTO_MAX = 256 IPPORT_RESERVED = 1024 IPPORT_USERRESERVED = 5000 IPPORT_TIMESERVER = 37 -def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) +def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0) IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 24 IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_MAX = 128 -def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) +def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000) IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 16 IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_MAX = 65536 -def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) +def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000) IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 8 IN_CLASSC_HOST = 0x000000ff -def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) +def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000) def IN_MULTICAST(i): return IN_CLASSD(i) -def IN_EXPERIMENTAL(i): return (((long)(i) & 0xe0000000) == 0xe0000000) +def IN_EXPERIMENTAL(i): return (((int)(i) & 0xe0000000) == 0xe0000000) -def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) +def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000) INADDR_ANY = 0x00000000 INADDR_LOOPBACK = 0x7f000001 diff --git a/Lib/plat-aix4/IN.py b/Lib/plat-aix4/IN.py index 00f0e1f..43f8f23 100644 --- a/Lib/plat-aix4/IN.py +++ b/Lib/plat-aix4/IN.py @@ -111,24 +111,24 @@ IPPROTO_MAX = 256 IPPORT_RESERVED = 1024 IPPORT_USERRESERVED = 5000 IPPORT_TIMESERVER = 37 -def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) +def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0) IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 24 IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_MAX = 128 -def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) +def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000) IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 16 IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_MAX = 65536 -def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) +def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000) IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 8 IN_CLASSC_HOST = 0x000000ff -def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) +def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000) def IN_MULTICAST(i): return IN_CLASSD(i) @@ -138,9 +138,9 @@ IN_CLASSD_HOST = 0x0fffffff INADDR_UNSPEC_GROUP = 0xe0000000 INADDR_ALLHOSTS_GROUP = 0xe0000001 INADDR_MAX_LOCAL_GROUP = 0xe00000ff -def IN_EXPERIMENTAL(i): return (((long)(i) & 0xe0000000) == 0xe0000000) +def IN_EXPERIMENTAL(i): return (((int)(i) & 0xe0000000) == 0xe0000000) -def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) +def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000) INADDR_ANY = 0x00000000 INADDR_BROADCAST = 0xffffffff diff --git a/Lib/plat-atheos/IN.py b/Lib/plat-atheos/IN.py index 6588d65..4894495 100644 --- a/Lib/plat-atheos/IN.py +++ b/Lib/plat-atheos/IN.py @@ -7,7 +7,7 @@ __USE_ANSI = 1 __FAVOR_BSD = 1 _ISOC9X_SOURCE = 1 _POSIX_SOURCE = 1 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 _XOPEN_SOURCE = 500 _XOPEN_SOURCE_EXTENDED = 1 _LARGEFILE64_SOURCE = 1 @@ -18,7 +18,7 @@ _SVID_SOURCE = 1 __USE_ISOC9X = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 2 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 __USE_POSIX = 1 __USE_POSIX2 = 1 __USE_POSIX199309 = 1 @@ -110,8 +110,8 @@ CHAR_MAX = 127 CHAR_MIN = (-128) INT_MAX = 2147483647 INT_MIN = (-2147483647-1) -LONG_MAX = 2147483647L -LONG_MIN = (-2147483647L-1L) +LONG_MAX = 2147483647 +LONG_MIN = (-2147483647-1) SCHAR_MAX = 127 SCHAR_MIN = (-128) SHRT_MAX = 32767 @@ -206,10 +206,10 @@ USHRT_MAX = 65535 INT_MIN = (-INT_MAX - 1) INT_MAX = 2147483647 UINT_MAX = 4294967295 -LONG_MAX = 9223372036854775807L -LONG_MAX = 2147483647L -LONG_MIN = (-LONG_MAX - 1L) -ULONG_MAX = 4294967295L +LONG_MAX = 9223372036854775807 +LONG_MAX = 2147483647 +LONG_MIN = (-LONG_MAX - 1) +ULONG_MAX = 4294967295 # Included from stdint.h _STDINT_H = 1 @@ -243,27 +243,27 @@ INT_LEAST32_MAX = (2147483647) INT_LEAST64_MAX = (__INT64_C(9223372036854775807)) UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) INT_FAST8_MIN = (-128) -INT_FAST16_MIN = (-9223372036854775807L-1) -INT_FAST32_MIN = (-9223372036854775807L-1) +INT_FAST16_MIN = (-9223372036854775807-1) +INT_FAST32_MIN = (-9223372036854775807-1) INT_FAST16_MIN = (-2147483647-1) INT_FAST32_MIN = (-2147483647-1) INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) INT_FAST8_MAX = (127) -INT_FAST16_MAX = (9223372036854775807L) -INT_FAST32_MAX = (9223372036854775807L) +INT_FAST16_MAX = (9223372036854775807) +INT_FAST32_MAX = (9223372036854775807) INT_FAST16_MAX = (2147483647) INT_FAST32_MAX = (2147483647) INT_FAST64_MAX = (__INT64_C(9223372036854775807)) UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) -INTPTR_MIN = (-9223372036854775807L-1) -INTPTR_MAX = (9223372036854775807L) +INTPTR_MIN = (-9223372036854775807-1) +INTPTR_MAX = (9223372036854775807) INTPTR_MIN = (-2147483647-1) INTPTR_MAX = (2147483647) INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) INTMAX_MAX = (__INT64_C(9223372036854775807)) UINTMAX_MAX = (__UINT64_C(18446744073709551615)) -PTRDIFF_MIN = (-9223372036854775807L-1) -PTRDIFF_MAX = (9223372036854775807L) +PTRDIFF_MIN = (-9223372036854775807-1) +PTRDIFF_MAX = (9223372036854775807) PTRDIFF_MIN = (-2147483647-1) PTRDIFF_MAX = (2147483647) SIG_ATOMIC_MIN = (-2147483647-1) @@ -684,7 +684,7 @@ IP_ADR_LEN = 4 INADDR_ANY = 0x00000000 INADDR_BROADCAST = 0xffffffff INADDR_LOOPBACK = 0x7f000001 -def CMSG_ALIGN(len): return ( ((len)+sizeof(long)-1) & ~(sizeof(long)-1) ) +def CMSG_ALIGN(len): return ( ((len)+sizeof(int)-1) & ~(sizeof(int)-1) ) PROT_SOCK = 1024 SHUTDOWN_MASK = 3 diff --git a/Lib/plat-atheos/TYPES.py b/Lib/plat-atheos/TYPES.py index 314ca73..9d0be35 100644 --- a/Lib/plat-atheos/TYPES.py +++ b/Lib/plat-atheos/TYPES.py @@ -7,7 +7,7 @@ __USE_ANSI = 1 __FAVOR_BSD = 1 _ISOC9X_SOURCE = 1 _POSIX_SOURCE = 1 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 _XOPEN_SOURCE = 500 _XOPEN_SOURCE_EXTENDED = 1 _LARGEFILE64_SOURCE = 1 @@ -18,7 +18,7 @@ _SVID_SOURCE = 1 __USE_ISOC9X = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 2 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 __USE_POSIX = 1 __USE_POSIX2 = 1 __USE_POSIX199309 = 1 diff --git a/Lib/plat-beos5/IN.py b/Lib/plat-beos5/IN.py index 362cb41..ea3ee86 100644 --- a/Lib/plat-beos5/IN.py +++ b/Lib/plat-beos5/IN.py @@ -34,7 +34,7 @@ __GLIBC_MINOR__ = 1 # Included from null.h NULL = (0) -NULL = 0L +NULL = 0 # Included from size_t.h @@ -100,8 +100,8 @@ CHAR_MAX = SCHAR_MAX MB_LEN_MAX = (1) SHRT_MIN = (-32767-1) SHRT_MAX = (32767) -LONG_MIN = (-2147483647L-1) -LONG_MAX = (2147483647L) +LONG_MIN = (-2147483647-1) +LONG_MAX = (2147483647) INT_MIN = LONG_MIN INT_MAX = LONG_MAX ARG_MAX = (32768) @@ -118,7 +118,7 @@ NGROUPS_MAX = (32) OPEN_MAX = (128) PATH_MAX = (1024) PIPE_MAX = (512) -SSIZE_MAX = (2147483647L) +SSIZE_MAX = (2147483647) TTY_NAME_MAX = (256) TZNAME_MAX = (32) SYMLINKS_MAX = (16) @@ -133,7 +133,7 @@ _POSIX_NGROUPS_MAX = (0) _POSIX_OPEN_MAX = (128) _POSIX_PATH_MAX = (1024) _POSIX_PIPE_BUF = (512) -_POSIX_SSIZE_MAX = (2147483647L) +_POSIX_SSIZE_MAX = (2147483647) _POSIX_STREAM_MAX = (8) _POSIX_TTY_NAME_MAX = (256) _POSIX_TZNAME_MAX = (3) diff --git a/Lib/plat-freebsd2/IN.py b/Lib/plat-freebsd2/IN.py index 9f7e017..64dab8b 100644 --- a/Lib/plat-freebsd2/IN.py +++ b/Lib/plat-freebsd2/IN.py @@ -101,33 +101,33 @@ IPPORT_USERRESERVED = 5000 IPPORT_HIFIRSTAUTO = 40000 IPPORT_HILASTAUTO = 44999 IPPORT_RESERVEDSTART = 600 -def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) +def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0) IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 24 IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_MAX = 128 -def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) +def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000) IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 16 IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_MAX = 65536 -def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) +def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000) IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 8 IN_CLASSC_HOST = 0x000000ff -def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) +def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000) IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 28 IN_CLASSD_HOST = 0x0fffffff def IN_MULTICAST(i): return IN_CLASSD(i) -def IN_EXPERIMENTAL(i): return (((long)(i) & 0xf0000000) == 0xf0000000) +def IN_EXPERIMENTAL(i): return (((int)(i) & 0xf0000000) == 0xf0000000) -def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) +def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000) INADDR_ANY = 0x00000000 INADDR_BROADCAST = 0xffffffff diff --git a/Lib/plat-freebsd3/IN.py b/Lib/plat-freebsd3/IN.py index 1751445..81a430c 100644 --- a/Lib/plat-freebsd3/IN.py +++ b/Lib/plat-freebsd3/IN.py @@ -101,33 +101,33 @@ IPPORT_USERRESERVED = 5000 IPPORT_HIFIRSTAUTO = 49152 IPPORT_HILASTAUTO = 65535 IPPORT_RESERVEDSTART = 600 -def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) +def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0) IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 24 IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_MAX = 128 -def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) +def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000) IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 16 IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_MAX = 65536 -def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) +def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000) IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 8 IN_CLASSC_HOST = 0x000000ff -def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) +def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000) IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 28 IN_CLASSD_HOST = 0x0fffffff def IN_MULTICAST(i): return IN_CLASSD(i) -def IN_EXPERIMENTAL(i): return (((long)(i) & 0xf0000000) == 0xf0000000) +def IN_EXPERIMENTAL(i): return (((int)(i) & 0xf0000000) == 0xf0000000) -def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) +def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000) INADDR_ANY = 0x00000000 INADDR_LOOPBACK = 0x7f000001 diff --git a/Lib/plat-irix5/IN.py b/Lib/plat-irix5/IN.py index 2d67892..4ea6534 100755 --- a/Lib/plat-irix5/IN.py +++ b/Lib/plat-irix5/IN.py @@ -61,33 +61,33 @@ IPPROTO_MAX = 256 IPPORT_RESERVED = 1024 IPPORT_USERRESERVED = 5000 IPPORT_MAXPORT = 65535 -def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) +def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0) IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 24 IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_MAX = 128 -def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) +def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000) IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 16 IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_MAX = 65536 -def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) +def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000) IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 8 IN_CLASSC_HOST = 0x000000ff -def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) +def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000) IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 28 IN_CLASSD_HOST = 0x0fffffff def IN_MULTICAST(i): return IN_CLASSD(i) -def IN_EXPERIMENTAL(i): return (((long)(i) & 0xf0000000) == 0xf0000000) +def IN_EXPERIMENTAL(i): return (((int)(i) & 0xf0000000) == 0xf0000000) -def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) +def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000) INADDR_ANY = 0x00000000 INADDR_BROADCAST = 0xffffffff diff --git a/Lib/plat-irix6/FILE.py b/Lib/plat-irix6/FILE.py index ab74d7c..71b2202 100644 --- a/Lib/plat-irix6/FILE.py +++ b/Lib/plat-irix6/FILE.py @@ -43,7 +43,7 @@ FD_SETSIZE = 1024 __NBBY = 8 # Included from string.h -NULL = 0L +NULL = 0 NBBY = 8 # Included from sys/cpumask.h @@ -332,9 +332,9 @@ CTX_FS5 = 30 SV_ONSTACK = 0x0001 SV_INTERRUPT = 0x0002 NUMBSDSIGS = (32) -def sigmask(sig): return (1L << ((sig)-1)) +def sigmask(sig): return (1 << ((sig)-1)) -def sigmask(sig): return (1L << ((sig)-1)) +def sigmask(sig): return (1 << ((sig)-1)) SIG_ERR = (-1) SIG_IGN = (1) @@ -356,7 +356,7 @@ BRK_PSEUDO_OP_BIT = 0x80 BRK_PSEUDO_OP_MAX = 0x3 BRK_CACHE_SYNC = 0x80 BRK_MULOVF = 1023 -_POSIX_VERSION = 199506L +_POSIX_VERSION = 199506 _POSIX_VERSION = 199506 _POSIX_VDISABLE = 0 MAX_INPUT = 512 @@ -414,7 +414,7 @@ BPCSHIFT = 14 CPSSHIFT = 12 CPSSHIFT = 11 BPSSHIFT = (BPCSHIFT+CPSSHIFT) -NULL = 0L +NULL = 0 CMASK = 022 NODEV = (-1) NOPAGE = (-1) @@ -464,7 +464,7 @@ def DELAY(n): return us_delay(n) def DELAYBUS(n): return us_delaybus(n) -TIMEPOKE_NOW = -100L +TIMEPOKE_NOW = -100 MUTEX_DEFAULT = 0x0 METER_NAMSZ = 16 METER_NO_SEQ = -1 diff --git a/Lib/plat-irix6/IN.py b/Lib/plat-irix6/IN.py index 9385bb0..5f91050 100644 --- a/Lib/plat-irix6/IN.py +++ b/Lib/plat-irix6/IN.py @@ -37,7 +37,7 @@ FD_SETSIZE = 1024 __NBBY = 8 # Included from string.h -NULL = 0L +NULL = 0 NBBY = 8 # Included from sys/endian.h diff --git a/Lib/plat-irix6/WAIT.py b/Lib/plat-irix6/WAIT.py index 741af3b..13a87e4 100644 --- a/Lib/plat-irix6/WAIT.py +++ b/Lib/plat-irix6/WAIT.py @@ -68,7 +68,7 @@ FD_SETSIZE = 1024 __NBBY = 8 # Included from string.h -NULL = 0L +NULL = 0 NBBY = 8 # Included from sys/procset.h @@ -286,9 +286,9 @@ CXT_SR = CTX_SR SV_ONSTACK = 0x0001 SV_INTERRUPT = 0x0002 NUMBSDSIGS = (32) -def sigmask(sig): return (1L << ((sig)-1)) +def sigmask(sig): return (1 << ((sig)-1)) -def sigmask(sig): return (1L << ((sig)-1)) +def sigmask(sig): return (1 << ((sig)-1)) SIG_ERR = (-1) SIG_IGN = (1) diff --git a/Lib/plat-linux2/DLFCN.py b/Lib/plat-linux2/DLFCN.py index e23340a..dd10ac4 100644 --- a/Lib/plat-linux2/DLFCN.py +++ b/Lib/plat-linux2/DLFCN.py @@ -7,7 +7,7 @@ __USE_ANSI = 1 __FAVOR_BSD = 1 _ISOC99_SOURCE = 1 _POSIX_SOURCE = 1 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 _XOPEN_SOURCE = 600 _XOPEN_SOURCE_EXTENDED = 1 _LARGEFILE64_SOURCE = 1 @@ -18,7 +18,7 @@ _SVID_SOURCE = 1 __USE_ISOC99 = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 2 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 __USE_POSIX = 1 __USE_POSIX2 = 1 __USE_POSIX199309 = 1 @@ -40,7 +40,7 @@ __USE_GNU = 1 __USE_REENTRANT = 1 __STDC_IEC_559__ = 1 __STDC_IEC_559_COMPLEX__ = 1 -__STDC_ISO_10646__ = 200009L +__STDC_ISO_10646__ = 200009 __GNU_LIBRARY__ = 6 __GLIBC__ = 2 __GLIBC_MINOR__ = 2 diff --git a/Lib/plat-linux2/IN.py b/Lib/plat-linux2/IN.py index ad307f6..d7d3002 100644 --- a/Lib/plat-linux2/IN.py +++ b/Lib/plat-linux2/IN.py @@ -7,7 +7,7 @@ __USE_ANSI = 1 __FAVOR_BSD = 1 _ISOC99_SOURCE = 1 _POSIX_SOURCE = 1 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 _XOPEN_SOURCE = 600 _XOPEN_SOURCE_EXTENDED = 1 _LARGEFILE64_SOURCE = 1 @@ -18,7 +18,7 @@ _SVID_SOURCE = 1 __USE_ISOC99 = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 2 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 __USE_POSIX = 1 __USE_POSIX2 = 1 __USE_POSIX199309 = 1 @@ -40,7 +40,7 @@ __USE_GNU = 1 __USE_REENTRANT = 1 __STDC_IEC_559__ = 1 __STDC_IEC_559_COMPLEX__ = 1 -__STDC_ISO_10646__ = 200009L +__STDC_ISO_10646__ = 200009 __GNU_LIBRARY__ = 6 __GLIBC__ = 2 __GLIBC_MINOR__ = 2 @@ -78,8 +78,8 @@ _STDINT_H = 1 # Included from bits/wchar.h _BITS_WCHAR_H = 1 -__WCHAR_MIN = (-2147483647l - 1l) -__WCHAR_MAX = (2147483647l) +__WCHAR_MIN = (-2147483647 - 1) +__WCHAR_MAX = (2147483647) # Included from bits/wordsize.h __WORDSIZE = 32 @@ -114,28 +114,28 @@ UINT_LEAST8_MAX = (255) UINT_LEAST16_MAX = (65535) UINT_LEAST64_MAX = (__UINT64_C(18446744073709551615)) INT_FAST8_MIN = (-128) -INT_FAST16_MIN = (-9223372036854775807L-1) -INT_FAST32_MIN = (-9223372036854775807L-1) +INT_FAST16_MIN = (-9223372036854775807-1) +INT_FAST32_MIN = (-9223372036854775807-1) INT_FAST16_MIN = (-2147483647-1) INT_FAST32_MIN = (-2147483647-1) INT_FAST64_MIN = (-__INT64_C(9223372036854775807)-1) INT_FAST8_MAX = (127) -INT_FAST16_MAX = (9223372036854775807L) -INT_FAST32_MAX = (9223372036854775807L) +INT_FAST16_MAX = (9223372036854775807) +INT_FAST32_MAX = (9223372036854775807) INT_FAST16_MAX = (2147483647) INT_FAST32_MAX = (2147483647) INT_FAST64_MAX = (__INT64_C(9223372036854775807)) UINT_FAST8_MAX = (255) UINT_FAST64_MAX = (__UINT64_C(18446744073709551615)) -INTPTR_MIN = (-9223372036854775807L-1) -INTPTR_MAX = (9223372036854775807L) +INTPTR_MIN = (-9223372036854775807-1) +INTPTR_MAX = (9223372036854775807) INTPTR_MIN = (-2147483647-1) INTPTR_MAX = (2147483647) INTMAX_MIN = (-__INT64_C(9223372036854775807)-1) INTMAX_MAX = (__INT64_C(9223372036854775807)) UINTMAX_MAX = (__UINT64_C(18446744073709551615)) -PTRDIFF_MIN = (-9223372036854775807L-1) -PTRDIFF_MAX = (9223372036854775807L) +PTRDIFF_MIN = (-9223372036854775807-1) +PTRDIFF_MAX = (9223372036854775807) PTRDIFF_MIN = (-2147483647-1) PTRDIFF_MAX = (2147483647) SIG_ATOMIC_MIN = (-2147483647-1) @@ -238,9 +238,9 @@ SHRT_MIN = (-32768) SHRT_MAX = 32767 USHRT_MAX = 65535 INT_MAX = 2147483647 -LONG_MAX = 9223372036854775807L -LONG_MAX = 2147483647L -LONG_MIN = (-LONG_MAX - 1L) +LONG_MAX = 9223372036854775807 +LONG_MAX = 2147483647 +LONG_MIN = (-LONG_MAX - 1) # Included from bits/posix1_lim.h _BITS_POSIX1_LIM_H = 1 diff --git a/Lib/plat-linux2/TYPES.py b/Lib/plat-linux2/TYPES.py index 0cdd599..e7a324b 100644 --- a/Lib/plat-linux2/TYPES.py +++ b/Lib/plat-linux2/TYPES.py @@ -7,7 +7,7 @@ __USE_ANSI = 1 __FAVOR_BSD = 1 _ISOC99_SOURCE = 1 _POSIX_SOURCE = 1 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 _XOPEN_SOURCE = 600 _XOPEN_SOURCE_EXTENDED = 1 _LARGEFILE64_SOURCE = 1 @@ -18,7 +18,7 @@ _SVID_SOURCE = 1 __USE_ISOC99 = 1 _POSIX_SOURCE = 1 _POSIX_C_SOURCE = 2 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 __USE_POSIX = 1 __USE_POSIX2 = 1 __USE_POSIX199309 = 1 @@ -40,7 +40,7 @@ __USE_GNU = 1 __USE_REENTRANT = 1 __STDC_IEC_559__ = 1 __STDC_IEC_559_COMPLEX__ = 1 -__STDC_ISO_10646__ = 200009L +__STDC_ISO_10646__ = 200009 __GNU_LIBRARY__ = 6 __GLIBC__ = 2 __GLIBC_MINOR__ = 2 @@ -99,7 +99,7 @@ _TIME_H = 1 # Included from bits/time.h _BITS_TIME_H = 1 -CLOCKS_PER_SEC = 1000000l +CLOCKS_PER_SEC = 1000000 CLOCK_REALTIME = 0 CLOCK_PROCESS_CPUTIME_ID = 2 CLOCK_THREAD_CPUTIME_ID = 3 diff --git a/Lib/plat-mac/Carbon/CarbonEvents.py b/Lib/plat-mac/Carbon/CarbonEvents.py index 357ee5d..aa44069 100755 --- a/Lib/plat-mac/Carbon/CarbonEvents.py +++ b/Lib/plat-mac/Carbon/CarbonEvents.py @@ -74,8 +74,8 @@ kEventHotKeyPressed = 5 kEventHotKeyReleased = 6 kEventKeyModifierNumLockBit = 16 kEventKeyModifierFnBit = 17 -kEventKeyModifierNumLockMask = 1L << kEventKeyModifierNumLockBit -kEventKeyModifierFnMask = 1L << kEventKeyModifierFnBit +kEventKeyModifierNumLockMask = 1 << kEventKeyModifierNumLockBit +kEventKeyModifierFnMask = 1 << kEventKeyModifierFnBit kEventAppActivated = 1 kEventAppDeactivated = 2 kEventAppQuit = 3 @@ -221,9 +221,9 @@ kHICommandRevert = FOUR_CHAR_CODE('rvrt') kHICommandPrint = FOUR_CHAR_CODE('prnt') kHICommandPageSetup = FOUR_CHAR_CODE('page') kHICommandAppHelp = FOUR_CHAR_CODE('ahlp') -kHICommandFromMenu = (1L << 0) -kHICommandFromControl = (1L << 1) -kHICommandFromWindow = (1L << 2) +kHICommandFromMenu = (1 << 0) +kHICommandFromControl = (1 << 1) +kHICommandFromWindow = (1 << 2) kEventControlInitialize = 1000 kEventControlDispose = 1001 kEventControlGetOptimalBounds = 1003 diff --git a/Lib/plat-mac/Carbon/Components.py b/Lib/plat-mac/Carbon/Components.py index 75574cf..6c0ec96 100644 --- a/Lib/plat-mac/Carbon/Components.py +++ b/Lib/plat-mac/Carbon/Components.py @@ -8,8 +8,8 @@ kAnyComponentType = 0 kAnyComponentSubType = 0 kAnyComponentManufacturer = 0 kAnyComponentFlagsMask = 0 -cmpIsMissing = 1L << 29 -cmpWantsRegisterMessage = 1L << 31 +cmpIsMissing = 1 << 29 +cmpWantsRegisterMessage = 1 << 31 kComponentOpenSelect = -1 kComponentCloseSelect = -2 kComponentCanDoSelect = -3 diff --git a/Lib/plat-mac/Carbon/Controls.py b/Lib/plat-mac/Carbon/Controls.py index 6e5d8ea..d40a580 100644 --- a/Lib/plat-mac/Carbon/Controls.py +++ b/Lib/plat-mac/Carbon/Controls.py @@ -18,7 +18,7 @@ controlNotifyNothing = FOUR_CHAR_CODE('nada') controlNotifyClick = FOUR_CHAR_CODE('clik') controlNotifyFocus = FOUR_CHAR_CODE('focu') controlNotifyKey = FOUR_CHAR_CODE('key ') -kControlCanAutoInvalidate = 1L << 0 +kControlCanAutoInvalidate = 1 << 0 staticTextProc = 256 editTextProc = 272 iconProc = 288 @@ -529,7 +529,7 @@ kDataBrowserNeverEmptySelectionSet = 1 << 6 kDataBrowserOrderUndefined = 0 kDataBrowserOrderIncreasing = 1 kDataBrowserOrderDecreasing = 2 -kDataBrowserNoItem = 0L +kDataBrowserNoItem = 0 kDataBrowserItemNoState = 0 # kDataBrowserItemAnyState = (unsigned long)(-1) kDataBrowserItemIsSelected = 1 << 0 @@ -569,18 +569,18 @@ kDataBrowserUserToggledContainer = 16 kDataBrowserTargetChanged = 15 kDataBrowserUserStateChanged = 13 kDataBrowserSelectionSetChanged = 14 -kDataBrowserItemNoProperty = 0L -kDataBrowserItemIsActiveProperty = 1L -kDataBrowserItemIsSelectableProperty = 2L -kDataBrowserItemIsEditableProperty = 3L -kDataBrowserItemIsContainerProperty = 4L -kDataBrowserContainerIsOpenableProperty = 5L -kDataBrowserContainerIsClosableProperty = 6L -kDataBrowserContainerIsSortableProperty = 7L -kDataBrowserItemSelfIdentityProperty = 8L -kDataBrowserContainerAliasIDProperty = 9L -kDataBrowserColumnViewPreviewProperty = 10L -kDataBrowserItemParentContainerProperty = 11L +kDataBrowserItemNoProperty = 0 +kDataBrowserItemIsActiveProperty = 1 +kDataBrowserItemIsSelectableProperty = 2 +kDataBrowserItemIsEditableProperty = 3 +kDataBrowserItemIsContainerProperty = 4 +kDataBrowserContainerIsOpenableProperty = 5 +kDataBrowserContainerIsClosableProperty = 6 +kDataBrowserContainerIsSortableProperty = 7 +kDataBrowserItemSelfIdentityProperty = 8 +kDataBrowserContainerAliasIDProperty = 9 +kDataBrowserColumnViewPreviewProperty = 10 +kDataBrowserItemParentContainerProperty = 11 kDataBrowserCustomType = 0x3F3F3F3F kDataBrowserIconType = FOUR_CHAR_CODE('icnr') kDataBrowserTextType = FOUR_CHAR_CODE('text') @@ -591,7 +591,7 @@ kDataBrowserProgressBarType = FOUR_CHAR_CODE('prog') kDataBrowserRelevanceRankType = FOUR_CHAR_CODE('rank') kDataBrowserPopupMenuType = FOUR_CHAR_CODE('menu') kDataBrowserIconAndTextType = FOUR_CHAR_CODE('ticn') -kDataBrowserPropertyEnclosingPart = 0L +kDataBrowserPropertyEnclosingPart = 0 kDataBrowserPropertyContentPart = FOUR_CHAR_CODE('----') kDataBrowserPropertyDisclosurePart = FOUR_CHAR_CODE('disc') kDataBrowserPropertyTextPart = kDataBrowserTextType diff --git a/Lib/plat-mac/Carbon/Dragconst.py b/Lib/plat-mac/Carbon/Dragconst.py index 38e12be..6392c2b 100644 --- a/Lib/plat-mac/Carbon/Dragconst.py +++ b/Lib/plat-mac/Carbon/Dragconst.py @@ -14,16 +14,16 @@ flavorSenderOnly = (1 << 0) flavorSenderTranslated = (1 << 1) flavorNotSaved = (1 << 2) flavorSystemTranslated = (1 << 8) -kDragHasLeftSenderWindow = (1L << 0) -kDragInsideSenderApplication = (1L << 1) -kDragInsideSenderWindow = (1L << 2) +kDragHasLeftSenderWindow = (1 << 0) +kDragInsideSenderApplication = (1 << 1) +kDragInsideSenderWindow = (1 << 2) kDragBehaviorNone = 0 -kDragBehaviorZoomBackAnimation = (1L << 0) -kDragRegionAndImage = (1L << 4) -kDragStandardTranslucency = 0L -kDragDarkTranslucency = 1L -kDragDarkerTranslucency = 2L -kDragOpaqueTranslucency = 3L +kDragBehaviorZoomBackAnimation = (1 << 0) +kDragRegionAndImage = (1 << 4) +kDragStandardTranslucency = 0 +kDragDarkTranslucency = 1 +kDragDarkerTranslucency = 2 +kDragOpaqueTranslucency = 3 kDragRegionBegin = 1 kDragRegionDraw = 2 kDragRegionHide = 3 @@ -56,13 +56,13 @@ kDragTrackingEnterWindow = 2 kDragTrackingInWindow = 3 kDragTrackingLeaveWindow = 4 kDragTrackingLeaveHandler = 5 -kDragActionNothing = 0L -kDragActionCopy = 1L -kDragActionAlias = (1L << 1) -kDragActionGeneric = (1L << 2) -kDragActionPrivate = (1L << 3) -kDragActionMove = (1L << 4) -kDragActionDelete = (1L << 5) +kDragActionNothing = 0 +kDragActionCopy = 1 +kDragActionAlias = (1 << 1) +kDragActionGeneric = (1 << 2) +kDragActionPrivate = (1 << 3) +kDragActionMove = (1 << 4) +kDragActionDelete = (1 << 5) # kDragActionAll = (long)0xFFFFFFFF dragHasLeftSenderWindow = kDragHasLeftSenderWindow dragInsideSenderApplication = kDragInsideSenderApplication diff --git a/Lib/plat-mac/Carbon/Folders.py b/Lib/plat-mac/Carbon/Folders.py index 52cf158..dbf2d6b 100644 --- a/Lib/plat-mac/Carbon/Folders.py +++ b/Lib/plat-mac/Carbon/Folders.py @@ -3,7 +3,7 @@ def FOUR_CHAR_CODE(x): return x true = True false = False -kOnSystemDisk = -32768L +kOnSystemDisk = -32768 kOnAppropriateDisk = -32767 kSystemDomain = -32766 kLocalDomain = -32765 diff --git a/Lib/plat-mac/Carbon/Fonts.py b/Lib/plat-mac/Carbon/Fonts.py index 8be7e7a..dab3fa2 100644 --- a/Lib/plat-mac/Carbon/Fonts.py +++ b/Lib/plat-mac/Carbon/Fonts.py @@ -17,15 +17,15 @@ commandMark = 17 checkMark = 18 diamondMark = 19 appleMark = 20 -propFont = 36864L -prpFntH = 36865L -prpFntW = 36866L -prpFntHW = 36867L -fixedFont = 45056L -fxdFntH = 45057L -fxdFntW = 45058L -fxdFntHW = 45059L -fontWid = 44208L +propFont = 36864 +prpFntH = 36865 +prpFntW = 36866 +prpFntHW = 36867 +fixedFont = 45056 +fxdFntH = 45057 +fxdFntW = 45058 +fxdFntHW = 45059 +fontWid = 44208 kFMUseGlobalScopeOption = 0x00000001 kFontIDNewYork = 2 kFontIDGeneva = 3 diff --git a/Lib/plat-mac/Carbon/Icons.py b/Lib/plat-mac/Carbon/Icons.py index 86dae63..b5daea2 100644 --- a/Lib/plat-mac/Carbon/Icons.py +++ b/Lib/plat-mac/Carbon/Icons.py @@ -375,7 +375,7 @@ kBurningIcon = FOUR_CHAR_CODE('burn') kRightContainerArrowIcon = FOUR_CHAR_CODE('rcar') kIconServicesNormalUsageFlag = 0 kIconServicesCatalogInfoMask = (kFSCatInfoNodeID | kFSCatInfoParentDirID | kFSCatInfoVolume | kFSCatInfoNodeFlags | kFSCatInfoFinderInfo | kFSCatInfoFinderXInfo | kFSCatInfoUserAccess) -kPlotIconRefNormalFlags = 0L +kPlotIconRefNormalFlags = 0 kPlotIconRefNoImage = (1 << 1) kPlotIconRefNoMask = (1 << 2) kIconFamilyType = FOUR_CHAR_CODE('icns') diff --git a/Lib/plat-mac/Carbon/MacTextEditor.py b/Lib/plat-mac/Carbon/MacTextEditor.py index 4609d8d..aa8a12e 100644 --- a/Lib/plat-mac/Carbon/MacTextEditor.py +++ b/Lib/plat-mac/Carbon/MacTextEditor.py @@ -17,18 +17,18 @@ kTXNFontSizeAttributeSize = 4 normal = 0 kTXNWillDefaultToATSUIBit = 0 kTXNWillDefaultToCarbonEventBit = 1 -kTXNWillDefaultToATSUIMask = 1L << kTXNWillDefaultToATSUIBit -kTXNWillDefaultToCarbonEventMask = 1L << kTXNWillDefaultToCarbonEventBit +kTXNWillDefaultToATSUIMask = 1 << kTXNWillDefaultToATSUIBit +kTXNWillDefaultToCarbonEventMask = 1 << kTXNWillDefaultToCarbonEventBit kTXNWantMoviesBit = 0 kTXNWantSoundBit = 1 kTXNWantGraphicsBit = 2 kTXNAlwaysUseQuickDrawTextBit = 3 kTXNUseTemporaryMemoryBit = 4 -kTXNWantMoviesMask = 1L << kTXNWantMoviesBit -kTXNWantSoundMask = 1L << kTXNWantSoundBit -kTXNWantGraphicsMask = 1L << kTXNWantGraphicsBit -kTXNAlwaysUseQuickDrawTextMask = 1L << kTXNAlwaysUseQuickDrawTextBit -kTXNUseTemporaryMemoryMask = 1L << kTXNUseTemporaryMemoryBit +kTXNWantMoviesMask = 1 << kTXNWantMoviesBit +kTXNWantSoundMask = 1 << kTXNWantSoundBit +kTXNWantGraphicsMask = 1 << kTXNWantGraphicsBit +kTXNAlwaysUseQuickDrawTextMask = 1 << kTXNAlwaysUseQuickDrawTextBit +kTXNUseTemporaryMemoryMask = 1 << kTXNUseTemporaryMemoryBit kTXNDrawGrowIconBit = 0 kTXNShowWindowBit = 1 kTXNWantHScrollBarBit = 2 @@ -46,23 +46,23 @@ kTXNDontDrawSelectionWhenInactiveBit = 13 kTXNSingleLineOnlyBit = 14 kTXNDisableDragAndDropBit = 15 kTXNUseQDforImagingBit = 16 -kTXNDrawGrowIconMask = 1L << kTXNDrawGrowIconBit -kTXNShowWindowMask = 1L << kTXNShowWindowBit -kTXNWantHScrollBarMask = 1L << kTXNWantHScrollBarBit -kTXNWantVScrollBarMask = 1L << kTXNWantVScrollBarBit -kTXNNoTSMEverMask = 1L << kTXNNoTSMEverBit -kTXNReadOnlyMask = 1L << kTXNReadOnlyBit -kTXNNoKeyboardSyncMask = 1L << kTXNNoKeyboardSyncBit -kTXNNoSelectionMask = 1L << kTXNNoSelectionBit -kTXNSaveStylesAsSTYLResourceMask = 1L << kTXNSaveStylesAsSTYLResourceBit -kOutputTextInUnicodeEncodingMask = 1L << kOutputTextInUnicodeEncodingBit -kTXNDoNotInstallDragProcsMask = 1L << kTXNDoNotInstallDragProcsBit -kTXNAlwaysWrapAtViewEdgeMask = 1L << kTXNAlwaysWrapAtViewEdgeBit -kTXNDontDrawCaretWhenInactiveMask = 1L << kTXNDontDrawCaretWhenInactiveBit -kTXNDontDrawSelectionWhenInactiveMask = 1L << kTXNDontDrawSelectionWhenInactiveBit -kTXNSingleLineOnlyMask = 1L << kTXNSingleLineOnlyBit -kTXNDisableDragAndDropMask = 1L << kTXNDisableDragAndDropBit -kTXNUseQDforImagingMask = 1L << kTXNUseQDforImagingBit +kTXNDrawGrowIconMask = 1 << kTXNDrawGrowIconBit +kTXNShowWindowMask = 1 << kTXNShowWindowBit +kTXNWantHScrollBarMask = 1 << kTXNWantHScrollBarBit +kTXNWantVScrollBarMask = 1 << kTXNWantVScrollBarBit +kTXNNoTSMEverMask = 1 << kTXNNoTSMEverBit +kTXNReadOnlyMask = 1 << kTXNReadOnlyBit +kTXNNoKeyboardSyncMask = 1 << kTXNNoKeyboardSyncBit +kTXNNoSelectionMask = 1 << kTXNNoSelectionBit +kTXNSaveStylesAsSTYLResourceMask = 1 << kTXNSaveStylesAsSTYLResourceBit +kOutputTextInUnicodeEncodingMask = 1 << kOutputTextInUnicodeEncodingBit +kTXNDoNotInstallDragProcsMask = 1 << kTXNDoNotInstallDragProcsBit +kTXNAlwaysWrapAtViewEdgeMask = 1 << kTXNAlwaysWrapAtViewEdgeBit +kTXNDontDrawCaretWhenInactiveMask = 1 << kTXNDontDrawCaretWhenInactiveBit +kTXNDontDrawSelectionWhenInactiveMask = 1 << kTXNDontDrawSelectionWhenInactiveBit +kTXNSingleLineOnlyMask = 1 << kTXNSingleLineOnlyBit +kTXNDisableDragAndDropMask = 1 << kTXNDisableDragAndDropBit +kTXNUseQDforImagingMask = 1 << kTXNUseQDforImagingBit kTXNSetFlushnessBit = 0 kTXNSetJustificationBit = 1 kTXNUseFontFallBackBit = 2 @@ -73,29 +73,29 @@ kTXNDontDrawTextBit = 6 kTXNUseCGContextRefBit = 7 kTXNImageWithQDBit = 8 kTXNDontWrapTextBit = 9 -kTXNSetFlushnessMask = 1L << kTXNSetFlushnessBit -kTXNSetJustificationMask = 1L << kTXNSetJustificationBit -kTXNUseFontFallBackMask = 1L << kTXNUseFontFallBackBit -kTXNRotateTextMask = 1L << kTXNRotateTextBit -kTXNUseVerticalTextMask = 1L << kTXNUseVerticalTextBit -kTXNDontUpdateBoxRectMask = 1L << kTXNDontUpdateBoxRectBit -kTXNDontDrawTextMask = 1L << kTXNDontDrawTextBit -kTXNUseCGContextRefMask = 1L << kTXNUseCGContextRefBit -kTXNImageWithQDMask = 1L << kTXNImageWithQDBit -kTXNDontWrapTextMask = 1L << kTXNDontWrapTextBit +kTXNSetFlushnessMask = 1 << kTXNSetFlushnessBit +kTXNSetJustificationMask = 1 << kTXNSetJustificationBit +kTXNUseFontFallBackMask = 1 << kTXNUseFontFallBackBit +kTXNRotateTextMask = 1 << kTXNRotateTextBit +kTXNUseVerticalTextMask = 1 << kTXNUseVerticalTextBit +kTXNDontUpdateBoxRectMask = 1 << kTXNDontUpdateBoxRectBit +kTXNDontDrawTextMask = 1 << kTXNDontDrawTextBit +kTXNUseCGContextRefMask = 1 << kTXNUseCGContextRefBit +kTXNImageWithQDMask = 1 << kTXNImageWithQDBit +kTXNDontWrapTextMask = 1 << kTXNDontWrapTextBit kTXNFontContinuousBit = 0 kTXNSizeContinuousBit = 1 kTXNStyleContinuousBit = 2 kTXNColorContinuousBit = 3 -kTXNFontContinuousMask = 1L << kTXNFontContinuousBit -kTXNSizeContinuousMask = 1L << kTXNSizeContinuousBit -kTXNStyleContinuousMask = 1L << kTXNStyleContinuousBit -kTXNColorContinuousMask = 1L << kTXNColorContinuousBit +kTXNFontContinuousMask = 1 << kTXNFontContinuousBit +kTXNSizeContinuousMask = 1 << kTXNSizeContinuousBit +kTXNStyleContinuousMask = 1 << kTXNStyleContinuousBit +kTXNColorContinuousMask = 1 << kTXNColorContinuousBit kTXNIgnoreCaseBit = 0 kTXNEntireWordBit = 1 kTXNUseEncodingWordRulesBit = 31 -kTXNIgnoreCaseMask = 1L << kTXNIgnoreCaseBit -kTXNEntireWordMask = 1L << kTXNEntireWordBit +kTXNIgnoreCaseMask = 1 << kTXNIgnoreCaseBit +kTXNEntireWordMask = 1 << kTXNEntireWordBit # kTXNUseEncodingWordRulesMask = (unsigned long)(1L << kTXNUseEncodingWordRulesBit) kTXNTextensionFile = FOUR_CHAR_CODE('txtn') kTXNTextFile = FOUR_CHAR_CODE('TEXT') @@ -216,8 +216,8 @@ kTXNUnicodeEncoding = 2 kTXNBackgroundTypeRGB = 1 kTXNTextInputCountBit = 0 kTXNRunCountBit = 1 -kTXNTextInputCountMask = 1L << kTXNTextInputCountBit -kTXNRunCountMask = 1L << kTXNRunCountBit +kTXNTextInputCountMask = 1 << kTXNTextInputCountBit +kTXNRunCountMask = 1 << kTXNRunCountBit kTXNAllCountMask = kTXNTextInputCountMask | kTXNRunCountMask kTXNNoAppleEventHandlersBit = 0 kTXNRestartAppleEventHandlersBit = 1 diff --git a/Lib/plat-mac/Carbon/OSAconst.py b/Lib/plat-mac/Carbon/OSAconst.py index 3b64c24..99b3205 100644 --- a/Lib/plat-mac/Carbon/OSAconst.py +++ b/Lib/plat-mac/Carbon/OSAconst.py @@ -19,7 +19,7 @@ keyOSADialectName = FOUR_CHAR_CODE('dnam') keyOSADialectCode = FOUR_CHAR_CODE('dcod') keyOSADialectLangCode = FOUR_CHAR_CODE('dlcd') keyOSADialectScriptCode = FOUR_CHAR_CODE('dscd') -kOSANullScript = 0L +kOSANullScript = 0 kOSANullMode = 0 kOSAModeNull = 0 kOSASupportsCompiling = 0x0002 diff --git a/Lib/plat-mac/Carbon/QDOffscreen.py b/Lib/plat-mac/Carbon/QDOffscreen.py index b3f557e..bda14da 100644 --- a/Lib/plat-mac/Carbon/QDOffscreen.py +++ b/Lib/plat-mac/Carbon/QDOffscreen.py @@ -18,30 +18,30 @@ clipPixBit = 28 stretchPixBit = 29 ditherPixBit = 30 gwFlagErrBit = 31 -pixPurge = 1L << pixPurgeBit -noNewDevice = 1L << noNewDeviceBit -useTempMem = 1L << useTempMemBit -keepLocal = 1L << keepLocalBit -useDistantHdwrMem = 1L << useDistantHdwrMemBit -useLocalHdwrMem = 1L << useLocalHdwrMemBit -pixelsPurgeable = 1L << pixelsPurgeableBit -pixelsLocked = 1L << pixelsLockedBit -kAllocDirectDrawSurface = 1L << 14 -mapPix = 1L << mapPixBit -newDepth = 1L << newDepthBit -alignPix = 1L << alignPixBit -newRowBytes = 1L << newRowBytesBit -reallocPix = 1L << reallocPixBit -clipPix = 1L << clipPixBit -stretchPix = 1L << stretchPixBit -ditherPix = 1L << ditherPixBit -gwFlagErr = 1L << gwFlagErrBit -deviceIsIndirect = (1L << 0) -deviceNeedsLock = (1L << 1) -deviceIsStatic = (1L << 2) -deviceIsExternalBuffer = (1L << 3) -deviceIsDDSurface = (1L << 4) -deviceIsDCISurface = (1L << 5) -deviceIsGDISurface = (1L << 6) -deviceIsAScreen = (1L << 7) -deviceIsOverlaySurface = (1L << 8) +pixPurge = 1 << pixPurgeBit +noNewDevice = 1 << noNewDeviceBit +useTempMem = 1 << useTempMemBit +keepLocal = 1 << keepLocalBit +useDistantHdwrMem = 1 << useDistantHdwrMemBit +useLocalHdwrMem = 1 << useLocalHdwrMemBit +pixelsPurgeable = 1 << pixelsPurgeableBit +pixelsLocked = 1 << pixelsLockedBit +kAllocDirectDrawSurface = 1 << 14 +mapPix = 1 << mapPixBit +newDepth = 1 << newDepthBit +alignPix = 1 << alignPixBit +newRowBytes = 1 << newRowBytesBit +reallocPix = 1 << reallocPixBit +clipPix = 1 << clipPixBit +stretchPix = 1 << stretchPixBit +ditherPix = 1 << ditherPixBit +gwFlagErr = 1 << gwFlagErrBit +deviceIsIndirect = (1 << 0) +deviceNeedsLock = (1 << 1) +deviceIsStatic = (1 << 2) +deviceIsExternalBuffer = (1 << 3) +deviceIsDDSurface = (1 << 4) +deviceIsDCISurface = (1 << 5) +deviceIsGDISurface = (1 << 6) +deviceIsAScreen = (1 << 7) +deviceIsOverlaySurface = (1 << 8) diff --git a/Lib/plat-mac/Carbon/QuickDraw.py b/Lib/plat-mac/Carbon/QuickDraw.py index 65c2f9a..978f2a6 100644 --- a/Lib/plat-mac/Carbon/QuickDraw.py +++ b/Lib/plat-mac/Carbon/QuickDraw.py @@ -160,11 +160,11 @@ kXFer1PixelAtATime = 0x00000001 kXFerConvertPixelToRGB32 = 0x00000002 kCursorComponentsVersion = 0x00010001 kCursorComponentType = FOUR_CHAR_CODE('curs') -cursorDoesAnimate = 1L << 0 -cursorDoesHardware = 1L << 1 -cursorDoesUnreadableScreenBits = 1L << 2 -kRenderCursorInHardware = 1L << 0 -kRenderCursorInSoftware = 1L << 1 +cursorDoesAnimate = 1 << 0 +cursorDoesHardware = 1 << 1 +cursorDoesUnreadableScreenBits = 1 << 2 +kRenderCursorInHardware = 1 << 0 +kRenderCursorInSoftware = 1 << 1 kCursorComponentInit = 0x0001 kCursorComponentGetInfo = 0x0002 kCursorComponentSetOutputMode = 0x0003 diff --git a/Lib/plat-mac/Carbon/QuickTime.py b/Lib/plat-mac/Carbon/QuickTime.py index 8fba58c..0364a8f 100644 --- a/Lib/plat-mac/Carbon/QuickTime.py +++ b/Lib/plat-mac/Carbon/QuickTime.py @@ -94,14 +94,14 @@ kUserDataTextWarning = FOUR_CHAR_CODE('\xa9wrn') kUserDataTextWriter = FOUR_CHAR_CODE('\xa9wrt') kUserDataTextURLLink = FOUR_CHAR_CODE('\xa9url') kUserDataTextEditDate1 = FOUR_CHAR_CODE('\xa9ed1') -kUserDataUnicodeBit = 1L << 7 +kUserDataUnicodeBit = 1 << 7 DoTheRightThing = 0 kQTNetworkStatusNoNetwork = -2 kQTNetworkStatusUncertain = -1 kQTNetworkStatusNotConnected = 0 kQTNetworkStatusConnected = 1 -kMusicFlagDontPlay2Soft = 1L << 0 -kMusicFlagDontSlaveToMovie = 1L << 1 +kMusicFlagDontPlay2Soft = 1 << 0 +kMusicFlagDontSlaveToMovie = 1 << 1 dfDontDisplay = 1 << 0 dfDontAutoScale = 1 << 1 dfClipToTextBox = 1 << 2 @@ -119,10 +119,10 @@ dfAntiAlias = 1 << 13 dfKeyedText = 1 << 14 dfInverseHilite = 1 << 15 dfTextColorHilite = 1 << 16 -searchTextDontGoToFoundTime = 1L << 16 -searchTextDontHiliteFoundText = 1L << 17 -searchTextOneTrackOnly = 1L << 18 -searchTextEnabledTracksOnly = 1L << 19 +searchTextDontGoToFoundTime = 1 << 16 +searchTextDontHiliteFoundText = 1 << 17 +searchTextOneTrackOnly = 1 << 18 +searchTextEnabledTracksOnly = 1 << 19 kTextTextHandle = 1 kTextTextPtr = 2 kTextTEStyle = 3 @@ -167,7 +167,7 @@ mediaQualityDraft = 0x0000 mediaQualityNormal = 0x0040 mediaQualityBetter = 0x0080 mediaQualityBest = 0x00C0 -kQTEventPayloadIsQTList = 1L << 0 +kQTEventPayloadIsQTList = 1 << 0 kActionMovieSetVolume = 1024 kActionMovieSetRate = 1025 kActionMovieSetLoopingFlags = 1026 @@ -509,19 +509,19 @@ kQTEventMovieLoaded = FOUR_CHAR_CODE('load') kQTEventRequestToModifyMovie = FOUR_CHAR_CODE('reqm') kQTEventListReceived = FOUR_CHAR_CODE('list') kQTEventKeyUp = FOUR_CHAR_CODE('keyU') -kActionFlagActionIsDelta = 1L << 1 -kActionFlagParameterWrapsAround = 1L << 2 -kActionFlagActionIsToggle = 1L << 3 -kStatusStringIsURLLink = 1L << 1 -kStatusStringIsStreamingStatus = 1L << 2 -kStatusHasCodeNumber = 1L << 3 -kStatusIsError = 1L << 4 -kScriptIsUnknownType = 1L << 0 -kScriptIsJavaScript = 1L << 1 -kScriptIsLingoEvent = 1L << 2 -kScriptIsVBEvent = 1L << 3 -kScriptIsProjectorCommand = 1L << 4 -kScriptIsAppleScript = 1L << 5 +kActionFlagActionIsDelta = 1 << 1 +kActionFlagParameterWrapsAround = 1 << 2 +kActionFlagActionIsToggle = 1 << 3 +kStatusStringIsURLLink = 1 << 1 +kStatusStringIsStreamingStatus = 1 << 2 +kStatusHasCodeNumber = 1 << 3 +kStatusIsError = 1 << 4 +kScriptIsUnknownType = 1 << 0 +kScriptIsJavaScript = 1 << 1 +kScriptIsLingoEvent = 1 << 2 +kScriptIsVBEvent = 1 << 3 +kScriptIsProjectorCommand = 1 << 4 +kScriptIsAppleScript = 1 << 5 kQTRegistrationDialogTimeOutFlag = 1 << 0 kQTRegistrationDialogShowDialog = 1 << 1 kQTRegistrationDialogForceDialog = 1 << 2 @@ -605,16 +605,16 @@ nextTimeSyncSample = 1 << 3 nextTimeStep = 1 << 4 nextTimeEdgeOK = 1 << 14 nextTimeIgnoreActiveSegment = 1 << 15 -createMovieFileDeleteCurFile = 1L << 31 -createMovieFileDontCreateMovie = 1L << 30 -createMovieFileDontOpenFile = 1L << 29 -createMovieFileDontCreateResFile = 1L << 28 -flattenAddMovieToDataFork = 1L << 0 -flattenActiveTracksOnly = 1L << 2 -flattenDontInterleaveFlatten = 1L << 3 -flattenFSSpecPtrIsDataRefRecordPtr = 1L << 4 -flattenCompressMovieResource = 1L << 5 -flattenForceMovieResourceBeforeMovieData = 1L << 6 +createMovieFileDeleteCurFile = 1 << 31 +createMovieFileDontCreateMovie = 1 << 30 +createMovieFileDontOpenFile = 1 << 29 +createMovieFileDontCreateResFile = 1 << 28 +flattenAddMovieToDataFork = 1 << 0 +flattenActiveTracksOnly = 1 << 2 +flattenDontInterleaveFlatten = 1 << 3 +flattenFSSpecPtrIsDataRefRecordPtr = 1 << 4 +flattenCompressMovieResource = 1 << 5 +flattenForceMovieResourceBeforeMovieData = 1 << 6 movieInDataForkResID = -1 mcTopLeftMovie = 1 << 0 mcScaleMovieToFit = 1 << 1 @@ -645,17 +645,17 @@ hintsAllowDynamicResize = 1 << 19 hintsSingleField = 1 << 20 hintsNoRenderingTimeOut = 1 << 21 hintsFlushVideoInsteadOfDirtying = 1 << 22 -hintsEnableSubPixelPositioning = 1L << 23 +hintsEnableSubPixelPositioning = 1 << 23 mediaHandlerFlagBaseClient = 1 movieTrackMediaType = 1 << 0 movieTrackCharacteristic = 1 << 1 movieTrackEnabledOnly = 1 << 2 -kMovieControlOptionHideController = (1L << 0) -kMovieControlOptionLocateTopLeft = (1L << 1) -kMovieControlOptionEnableEditing = (1L << 2) -kMovieControlOptionHandleEditingHI = (1L << 3) -kMovieControlOptionSetKeysEnabled = (1L << 4) -kMovieControlOptionManuallyIdled = (1L << 5) +kMovieControlOptionHideController = (1 << 0) +kMovieControlOptionLocateTopLeft = (1 << 1) +kMovieControlOptionEnableEditing = (1 << 2) +kMovieControlOptionHandleEditingHI = (1 << 3) +kMovieControlOptionSetKeysEnabled = (1 << 4) +kMovieControlOptionManuallyIdled = (1 << 5) kMovieControlDataMovieController = FOUR_CHAR_CODE('mc ') kMovieControlDataMovie = FOUR_CHAR_CODE('moov') kMovieControlDataManualIdling = FOUR_CHAR_CODE('manu') @@ -663,33 +663,33 @@ movieDrawingCallWhenChanged = 0 movieDrawingCallAlways = 1 kQTCloneShareSamples = 1 << 0 kQTCloneDontCopyEdits = 1 << 1 -kGetMovieImporterValidateToFind = 1L << 0 -kGetMovieImporterAllowNewFile = 1L << 1 -kGetMovieImporterDontConsiderGraphicsImporters = 1L << 2 -kGetMovieImporterDontConsiderFileOnlyImporters = 1L << 6 -kGetMovieImporterAutoImportOnly = 1L << 10 +kGetMovieImporterValidateToFind = 1 << 0 +kGetMovieImporterAllowNewFile = 1 << 1 +kGetMovieImporterDontConsiderGraphicsImporters = 1 << 2 +kGetMovieImporterDontConsiderFileOnlyImporters = 1 << 6 +kGetMovieImporterAutoImportOnly = 1 << 10 kQTGetMIMETypeInfoIsQuickTimeMovieType = FOUR_CHAR_CODE('moov') kQTGetMIMETypeInfoIsUnhelpfulType = FOUR_CHAR_CODE('dumb') kQTCopyUserDataReplace = FOUR_CHAR_CODE('rplc') kQTCopyUserDataMerge = FOUR_CHAR_CODE('merg') -kMovieLoadStateError = -1L +kMovieLoadStateError = -1 kMovieLoadStateLoading = 1000 kMovieLoadStateLoaded = 2000 kMovieLoadStatePlayable = 10000 kMovieLoadStatePlaythroughOK = 20000 -kMovieLoadStateComplete = 100000L -kQTDontUseDataToFindImporter = 1L << 0 -kQTDontLookForMovieImporterIfGraphicsImporterFound = 1L << 1 -kQTAllowOpeningStillImagesAsMovies = 1L << 2 -kQTAllowImportersThatWouldCreateNewFile = 1L << 3 -kQTAllowAggressiveImporters = 1L << 4 -preloadAlways = 1L << 0 -preloadOnlyIfEnabled = 1L << 1 -fullScreenHideCursor = 1L << 0 -fullScreenAllowEvents = 1L << 1 -fullScreenDontChangeMenuBar = 1L << 2 -fullScreenPreflightSize = 1L << 3 -movieExecuteWiredActionDontExecute = 1L << 0 +kMovieLoadStateComplete = 100000 +kQTDontUseDataToFindImporter = 1 << 0 +kQTDontLookForMovieImporterIfGraphicsImporterFound = 1 << 1 +kQTAllowOpeningStillImagesAsMovies = 1 << 2 +kQTAllowImportersThatWouldCreateNewFile = 1 << 3 +kQTAllowAggressiveImporters = 1 << 4 +preloadAlways = 1 << 0 +preloadOnlyIfEnabled = 1 << 1 +fullScreenHideCursor = 1 << 0 +fullScreenAllowEvents = 1 << 1 +fullScreenDontChangeMenuBar = 1 << 2 +fullScreenPreflightSize = 1 << 3 +movieExecuteWiredActionDontExecute = 1 << 0 kRefConNavigationNext = 0 kRefConNavigationPrevious = 1 kRefConPropertyCanHaveFocus = 1 @@ -728,19 +728,19 @@ kSpriteHitTestUseSpritesOwnPropertiesMode = 0 kSpriteHitTestTreatAllSpritesAsHitTestableMode = 1 kSpriteHitTestTreatAllSpritesAsNotHitTestableMode = 2 kNoQTIdleEvents = -1 -kGetSpriteWorldInvalidRegionAndLeaveIntact = -1L -kGetSpriteWorldInvalidRegionAndThenSetEmpty = -2L -kOnlyDrawToSpriteWorld = 1L << 0 -kSpriteWorldPreflight = 1L << 1 -kSpriteWorldDidDraw = 1L << 0 -kSpriteWorldNeedsToDraw = 1L << 1 -kKeyFrameAndSingleOverride = 1L << 1 -kKeyFrameAndAllOverrides = 1L << 2 -kScaleSpritesToScaleWorld = 1L << 1 -kSpriteWorldHighQuality = 1L << 2 -kSpriteWorldDontAutoInvalidate = 1L << 3 -kSpriteWorldInvisible = 1L << 4 -kSpriteWorldDirtyInsteadOfFlush = 1L << 5 +kGetSpriteWorldInvalidRegionAndLeaveIntact = -1 +kGetSpriteWorldInvalidRegionAndThenSetEmpty = -2 +kOnlyDrawToSpriteWorld = 1 << 0 +kSpriteWorldPreflight = 1 << 1 +kSpriteWorldDidDraw = 1 << 0 +kSpriteWorldNeedsToDraw = 1 << 1 +kKeyFrameAndSingleOverride = 1 << 1 +kKeyFrameAndAllOverrides = 1 << 2 +kScaleSpritesToScaleWorld = 1 << 1 +kSpriteWorldHighQuality = 1 << 2 +kSpriteWorldDontAutoInvalidate = 1 << 3 +kSpriteWorldInvisible = 1 << 4 +kSpriteWorldDirtyInsteadOfFlush = 1 << 5 kParentAtomIsContainer = 0 kTweenRecordNoFlags = 0 kTweenRecordIsAtInterruptTime = 0x00000001 @@ -796,19 +796,19 @@ pdOptionsEditCurrentEffectOnly = 0x00000008 pdOptionsHidePreview = 0x00000010 effectIsRealtime = 0 kAccessKeyAtomType = FOUR_CHAR_CODE('acky') -kAccessKeySystemFlag = 1L << 0 +kAccessKeySystemFlag = 1 << 0 ConnectionSpeedPrefsType = FOUR_CHAR_CODE('cspd') BandwidthManagementPrefsType = FOUR_CHAR_CODE('bwmg') kQTIdlePriority = 10 kQTNonRealTimePriority = 20 kQTRealTimeSharedPriority = 25 kQTRealTimePriority = 30 -kQTBandwidthNotifyNeedToStop = 1L << 0 -kQTBandwidthNotifyGoodToGo = 1L << 1 -kQTBandwidthChangeRequest = 1L << 2 -kQTBandwidthQueueRequest = 1L << 3 -kQTBandwidthScheduledRequest = 1L << 4 -kQTBandwidthVoluntaryRelease = 1L << 5 +kQTBandwidthNotifyNeedToStop = 1 << 0 +kQTBandwidthNotifyGoodToGo = 1 << 1 +kQTBandwidthChangeRequest = 1 << 2 +kQTBandwidthQueueRequest = 1 << 3 +kQTBandwidthScheduledRequest = 1 << 4 +kQTBandwidthVoluntaryRelease = 1 << 5 kITextRemoveEverythingBut = 0 << 1 kITextRemoveLeaveSuggestedAlternate = 1 << 1 kITextAtomType = FOUR_CHAR_CODE('itxt') @@ -908,20 +908,20 @@ kListElementDataType = FOUR_CHAR_CODE('daty') kNameAtom = FOUR_CHAR_CODE('name') kInitialRotationAtom = FOUR_CHAR_CODE('inro') kNonLinearTweenHeader = FOUR_CHAR_CODE('nlth') -kTweenReturnDelta = 1L << 0 +kTweenReturnDelta = 1 << 0 kQTRestrictionClassSave = FOUR_CHAR_CODE('save') -kQTRestrictionSaveDontAddMovieResource = (1L << 0) -kQTRestrictionSaveDontFlatten = (1L << 1) -kQTRestrictionSaveDontExport = (1L << 2) -kQTRestrictionSaveDontExtract = (1L << 3) +kQTRestrictionSaveDontAddMovieResource = (1 << 0) +kQTRestrictionSaveDontFlatten = (1 << 1) +kQTRestrictionSaveDontExport = (1 << 2) +kQTRestrictionSaveDontExtract = (1 << 3) kQTRestrictionClassEdit = FOUR_CHAR_CODE('edit') -kQTRestrictionEditDontCopy = (1L << 0) -kQTRestrictionEditDontCut = (1L << 1) -kQTRestrictionEditDontPaste = (1L << 2) -kQTRestrictionEditDontClear = (1L << 3) -kQTRestrictionEditDontModify = (1L << 4) -kQTRestrictionEditDontExtract = (1L << 5) -videoFlagDontLeanAhead = 1L << 0 +kQTRestrictionEditDontCopy = (1 << 0) +kQTRestrictionEditDontCut = (1 << 1) +kQTRestrictionEditDontPaste = (1 << 2) +kQTRestrictionEditDontClear = (1 << 3) +kQTRestrictionEditDontModify = (1 << 4) +kQTRestrictionEditDontExtract = (1 << 5) +videoFlagDontLeanAhead = 1 << 0 txtProcDefaultDisplay = 0 txtProcDontDisplay = 1 txtProcDoDisplay = 2 @@ -932,12 +932,12 @@ findTextWrapAround = 1 << 3 findTextUseOffset = 1 << 4 dropShadowOffsetType = FOUR_CHAR_CODE('drpo') dropShadowTranslucencyType = FOUR_CHAR_CODE('drpt') -spriteHitTestBounds = 1L << 0 -spriteHitTestImage = 1L << 1 -spriteHitTestInvisibleSprites = 1L << 2 -spriteHitTestIsClick = 1L << 3 -spriteHitTestLocInDisplayCoordinates = 1L << 4 -spriteHitTestTreatAllSpritesAsHitTestable = 1L << 5 +spriteHitTestBounds = 1 << 0 +spriteHitTestImage = 1 << 1 +spriteHitTestInvisibleSprites = 1 << 2 +spriteHitTestIsClick = 1 << 3 +spriteHitTestLocInDisplayCoordinates = 1 << 4 +spriteHitTestTreatAllSpritesAsHitTestable = 1 << 5 kSpriteAtomType = FOUR_CHAR_CODE('sprt') kSpriteImagesContainerAtomType = FOUR_CHAR_CODE('imct') kSpriteImageAtomType = FOUR_CHAR_CODE('imag') @@ -1363,68 +1363,68 @@ k422YpCbCr8PixelFormat = FOUR_CHAR_CODE('2vuy') k4444YpCbCrA8PixelFormat = FOUR_CHAR_CODE('v408') k4444YpCbCrA8RPixelFormat = FOUR_CHAR_CODE('r408') kYUV420PixelFormat = FOUR_CHAR_CODE('y420') -codecInfoDoes1 = (1L << 0) -codecInfoDoes2 = (1L << 1) -codecInfoDoes4 = (1L << 2) -codecInfoDoes8 = (1L << 3) -codecInfoDoes16 = (1L << 4) -codecInfoDoes32 = (1L << 5) -codecInfoDoesDither = (1L << 6) -codecInfoDoesStretch = (1L << 7) -codecInfoDoesShrink = (1L << 8) -codecInfoDoesMask = (1L << 9) -codecInfoDoesTemporal = (1L << 10) -codecInfoDoesDouble = (1L << 11) -codecInfoDoesQuad = (1L << 12) -codecInfoDoesHalf = (1L << 13) -codecInfoDoesQuarter = (1L << 14) -codecInfoDoesRotate = (1L << 15) -codecInfoDoesHorizFlip = (1L << 16) -codecInfoDoesVertFlip = (1L << 17) -codecInfoHasEffectParameterList = (1L << 18) -codecInfoDoesBlend = (1L << 19) -codecInfoDoesWarp = (1L << 20) -codecInfoDoesRecompress = (1L << 21) -codecInfoDoesSpool = (1L << 22) -codecInfoDoesRateConstrain = (1L << 23) -codecInfoDepth1 = (1L << 0) -codecInfoDepth2 = (1L << 1) -codecInfoDepth4 = (1L << 2) -codecInfoDepth8 = (1L << 3) -codecInfoDepth16 = (1L << 4) -codecInfoDepth32 = (1L << 5) -codecInfoDepth24 = (1L << 6) -codecInfoDepth33 = (1L << 7) -codecInfoDepth34 = (1L << 8) -codecInfoDepth36 = (1L << 9) -codecInfoDepth40 = (1L << 10) -codecInfoStoresClut = (1L << 11) -codecInfoDoesLossless = (1L << 12) -codecInfoSequenceSensitive = (1L << 13) -codecFlagUseImageBuffer = (1L << 0) -codecFlagUseScreenBuffer = (1L << 1) -codecFlagUpdatePrevious = (1L << 2) -codecFlagNoScreenUpdate = (1L << 3) -codecFlagWasCompressed = (1L << 4) -codecFlagDontOffscreen = (1L << 5) -codecFlagUpdatePreviousComp = (1L << 6) -codecFlagForceKeyFrame = (1L << 7) -codecFlagOnlyScreenUpdate = (1L << 8) -codecFlagLiveGrab = (1L << 9) -codecFlagDiffFrame = (1L << 9) -codecFlagDontUseNewImageBuffer = (1L << 10) -codecFlagInterlaceUpdate = (1L << 11) -codecFlagCatchUpDiff = (1L << 12) -codecFlagSupportDisable = (1L << 13) -codecFlagReenable = (1L << 14) -codecFlagOutUpdateOnNextIdle = (1L << 9) -codecFlagOutUpdateOnDataSourceChange = (1L << 10) -codecFlagSequenceSensitive = (1L << 11) -codecFlagOutUpdateOnTimeChange = (1L << 12) -codecFlagImageBufferNotSourceImage = (1L << 13) -codecFlagUsedNewImageBuffer = (1L << 14) -codecFlagUsedImageBuffer = (1L << 15) -codecMinimumDataSize = 32768L +codecInfoDoes1 = (1 << 0) +codecInfoDoes2 = (1 << 1) +codecInfoDoes4 = (1 << 2) +codecInfoDoes8 = (1 << 3) +codecInfoDoes16 = (1 << 4) +codecInfoDoes32 = (1 << 5) +codecInfoDoesDither = (1 << 6) +codecInfoDoesStretch = (1 << 7) +codecInfoDoesShrink = (1 << 8) +codecInfoDoesMask = (1 << 9) +codecInfoDoesTemporal = (1 << 10) +codecInfoDoesDouble = (1 << 11) +codecInfoDoesQuad = (1 << 12) +codecInfoDoesHalf = (1 << 13) +codecInfoDoesQuarter = (1 << 14) +codecInfoDoesRotate = (1 << 15) +codecInfoDoesHorizFlip = (1 << 16) +codecInfoDoesVertFlip = (1 << 17) +codecInfoHasEffectParameterList = (1 << 18) +codecInfoDoesBlend = (1 << 19) +codecInfoDoesWarp = (1 << 20) +codecInfoDoesRecompress = (1 << 21) +codecInfoDoesSpool = (1 << 22) +codecInfoDoesRateConstrain = (1 << 23) +codecInfoDepth1 = (1 << 0) +codecInfoDepth2 = (1 << 1) +codecInfoDepth4 = (1 << 2) +codecInfoDepth8 = (1 << 3) +codecInfoDepth16 = (1 << 4) +codecInfoDepth32 = (1 << 5) +codecInfoDepth24 = (1 << 6) +codecInfoDepth33 = (1 << 7) +codecInfoDepth34 = (1 << 8) +codecInfoDepth36 = (1 << 9) +codecInfoDepth40 = (1 << 10) +codecInfoStoresClut = (1 << 11) +codecInfoDoesLossless = (1 << 12) +codecInfoSequenceSensitive = (1 << 13) +codecFlagUseImageBuffer = (1 << 0) +codecFlagUseScreenBuffer = (1 << 1) +codecFlagUpdatePrevious = (1 << 2) +codecFlagNoScreenUpdate = (1 << 3) +codecFlagWasCompressed = (1 << 4) +codecFlagDontOffscreen = (1 << 5) +codecFlagUpdatePreviousComp = (1 << 6) +codecFlagForceKeyFrame = (1 << 7) +codecFlagOnlyScreenUpdate = (1 << 8) +codecFlagLiveGrab = (1 << 9) +codecFlagDiffFrame = (1 << 9) +codecFlagDontUseNewImageBuffer = (1 << 10) +codecFlagInterlaceUpdate = (1 << 11) +codecFlagCatchUpDiff = (1 << 12) +codecFlagSupportDisable = (1 << 13) +codecFlagReenable = (1 << 14) +codecFlagOutUpdateOnNextIdle = (1 << 9) +codecFlagOutUpdateOnDataSourceChange = (1 << 10) +codecFlagSequenceSensitive = (1 << 11) +codecFlagOutUpdateOnTimeChange = (1 << 12) +codecFlagImageBufferNotSourceImage = (1 << 13) +codecFlagUsedNewImageBuffer = (1 << 14) +codecFlagUsedImageBuffer = (1 << 15) +codecMinimumDataSize = 32768 compressorComponentType = FOUR_CHAR_CODE('imco') decompressorComponentType = FOUR_CHAR_CODE('imdc') codecLosslessQuality = 0x00000400 @@ -1466,11 +1466,11 @@ evenField2ToOddFieldOut = 1 << 5 oddField2ToEvenFieldOut = 1 << 6 oddField2ToOddFieldOut = 1 << 7 icmFrameTimeHasVirtualStartTimeAndDuration = 1 << 0 -codecDSequenceDisableOverlaySurface = (1L << 5) -codecDSequenceSingleField = (1L << 6) -codecDSequenceBidirectionalPrediction = (1L << 7) -codecDSequenceFlushInsteadOfDirtying = (1L << 8) -codecDSequenceEnableSubPixelPositioning = (1L << 9) +codecDSequenceDisableOverlaySurface = (1 << 5) +codecDSequenceSingleField = (1 << 6) +codecDSequenceBidirectionalPrediction = (1 << 7) +codecDSequenceFlushInsteadOfDirtying = (1 << 8) +codecDSequenceEnableSubPixelPositioning = (1 << 9) kICMSequenceTaskWeight = FOUR_CHAR_CODE('twei') kICMSequenceTaskName = FOUR_CHAR_CODE('tnam') kICMSequenceUserPreferredCodecs = FOUR_CHAR_CODE('punt') @@ -1487,19 +1487,19 @@ sfpItemPreviewDividerUser = 13 sfpItemCreatePreviewButton = 14 sfpItemShowPreviewButton = 15 kICMPixelFormatIsPlanarMask = 0x0F -kICMPixelFormatIsIndexed = (1L << 4) -kICMPixelFormatIsSupportedByQD = (1L << 5) -kICMPixelFormatIsMonochrome = (1L << 6) -kICMPixelFormatHasAlphaChannel = (1L << 7) +kICMPixelFormatIsIndexed = (1 << 4) +kICMPixelFormatIsSupportedByQD = (1 << 5) +kICMPixelFormatIsMonochrome = (1 << 6) +kICMPixelFormatHasAlphaChannel = (1 << 7) kICMGetChainUltimateParent = 0 kICMGetChainParent = 1 kICMGetChainChild = 2 kICMGetChainUltimateChild = 3 -kDontUseValidateToFindGraphicsImporter = 1L << 0 -kICMTempThenAppMemory = 1L << 12 -kICMAppThenTempMemory = 1L << 13 +kDontUseValidateToFindGraphicsImporter = 1 << 0 +kICMTempThenAppMemory = 1 << 12 +kICMAppThenTempMemory = 1 << 13 kQTUsePlatformDefaultGammaLevel = 0 -kQTUseSourceGammaLevel = -1L +kQTUseSourceGammaLevel = -1 kQTCCIR601VideoGammaLevel = 0x00023333 identityMatrixType = 0x00 translateMatrixType = 0x01 @@ -1509,7 +1509,7 @@ linearMatrixType = 0x04 linearTranslateMatrixType = 0x05 perspectiveMatrixType = 0x06 GraphicsImporterComponentType = FOUR_CHAR_CODE('grip') -graphicsImporterUsesImageDecompressor = 1L << 23 +graphicsImporterUsesImageDecompressor = 1 << 23 quickTimeImageFileImageDescriptionAtom = FOUR_CHAR_CODE('idsc') quickTimeImageFileImageDataAtom = FOUR_CHAR_CODE('idat') quickTimeImageFileMetaDataAtom = FOUR_CHAR_CODE('meta') @@ -1517,9 +1517,9 @@ quickTimeImageFileColorSyncProfileAtom = FOUR_CHAR_CODE('iicc') graphicsImporterDrawsAllPixels = 0 graphicsImporterDoesntDrawAllPixels = 1 graphicsImporterDontKnowIfDrawAllPixels = 2 -kGraphicsImporterDontDoGammaCorrection = 1L << 0 -kGraphicsImporterTrustResolutionFromFile = 1L << 1 -kGraphicsImporterEnableSubPixelPositioning = 1L << 2 +kGraphicsImporterDontDoGammaCorrection = 1 << 0 +kGraphicsImporterTrustResolutionFromFile = 1 << 1 +kGraphicsImporterEnableSubPixelPositioning = 1 << 2 kGraphicsExportGroup = FOUR_CHAR_CODE('expo') kGraphicsExportFileType = FOUR_CHAR_CODE('ftyp') kGraphicsExportMIMEType = FOUR_CHAR_CODE('mime') @@ -1624,9 +1624,9 @@ kQTExifUserDataGPSDestDistanceRef = 0x06770019 kQTExifUserDataGPSDestDistance = 0x0677001A GraphicsExporterComponentType = FOUR_CHAR_CODE('grex') kBaseGraphicsExporterSubType = FOUR_CHAR_CODE('base') -graphicsExporterIsBaseExporter = 1L << 0 -graphicsExporterCanTranscode = 1L << 1 -graphicsExporterUsesImageCompressor = 1L << 2 +graphicsExporterIsBaseExporter = 1 << 0 +graphicsExporterCanTranscode = 1 << 1 +graphicsExporterUsesImageCompressor = 1 << 2 kQTResolutionSettings = FOUR_CHAR_CODE('reso') kQTTargetDataSize = FOUR_CHAR_CODE('dasz') kQTDontRecompress = FOUR_CHAR_CODE('dntr') @@ -1637,7 +1637,7 @@ kQTEnableExif = FOUR_CHAR_CODE('exif') kQTMetaData = FOUR_CHAR_CODE('meta') kQTTIFFCompressionMethod = FOUR_CHAR_CODE('tifc') kQTTIFFCompression_None = 1 -kQTTIFFCompression_PackBits = 32773L +kQTTIFFCompression_PackBits = 32773 kQTTIFFLittleEndian = FOUR_CHAR_CODE('tife') kQTPNGFilterPreference = FOUR_CHAR_CODE('pngf') kQTPNGFilterBestForColorType = FOUR_CHAR_CODE('bflt') @@ -1802,13 +1802,13 @@ kClockCanHandleIntermittentSound = 4 StandardCompressionType = FOUR_CHAR_CODE('scdi') StandardCompressionSubType = FOUR_CHAR_CODE('imag') StandardCompressionSubTypeSound = FOUR_CHAR_CODE('soun') -scListEveryCodec = 1L << 1 -scAllowZeroFrameRate = 1L << 2 -scAllowZeroKeyFrameRate = 1L << 3 -scShowBestDepth = 1L << 4 -scUseMovableModal = 1L << 5 -scDisableFrameRateItem = 1L << 6 -scShowDataRateAsKilobits = 1L << 7 +scListEveryCodec = 1 << 1 +scAllowZeroFrameRate = 1 << 2 +scAllowZeroKeyFrameRate = 1 << 3 +scShowBestDepth = 1 << 4 +scUseMovableModal = 1 << 5 +scDisableFrameRateItem = 1 << 6 +scShowDataRateAsKilobits = 1 << 7 scPreferCropping = 1 << 0 scPreferScaling = 1 << 1 scPreferScalingAndCropping = scPreferScaling | scPreferCropping @@ -1863,7 +1863,7 @@ scSoundInputSampleRateType = FOUR_CHAR_CODE('ssir') scSoundSampleRateChangeOK = FOUR_CHAR_CODE('rcok') scAvailableCompressionListType = FOUR_CHAR_CODE('avai') scGetCompression = 1 -scShowMotionSettings = 1L << 0 +scShowMotionSettings = 1 << 0 scSettingsChangedItem = -1 scCompressFlagIgnoreIdenticalFrames = 1 kQTSettingsVideo = FOUR_CHAR_CODE('vide') @@ -1897,14 +1897,14 @@ canMovieImportPartial = 1 << 13 hasMovieImportMIMEList = 1 << 14 canMovieImportAvoidBlocking = 1 << 15 canMovieExportFromProcedures = 1 << 15 -canMovieExportValidateMovie = 1L << 16 -movieImportMustGetDestinationMediaType = 1L << 16 -movieExportNeedsResourceFork = 1L << 17 -canMovieImportDataReferences = 1L << 18 -movieExportMustGetSourceMediaType = 1L << 19 -canMovieImportWithIdle = 1L << 20 -canMovieImportValidateDataReferences = 1L << 21 -reservedForUseByGraphicsImporters = 1L << 23 +canMovieExportValidateMovie = 1 << 16 +movieImportMustGetDestinationMediaType = 1 << 16 +movieExportNeedsResourceFork = 1 << 17 +canMovieImportDataReferences = 1 << 18 +movieExportMustGetSourceMediaType = 1 << 19 +canMovieImportWithIdle = 1 << 20 +canMovieImportValidateDataReferences = 1 << 21 +reservedForUseByGraphicsImporters = 1 << 23 movieImportCreateTrack = 1 movieImportInParallel = 2 movieImportMustUseTrack = 4 @@ -1925,20 +1925,20 @@ kQTMediaGroupResourceType = FOUR_CHAR_CODE('mgrp') kQTMediaGroupResourceVersion = 1 kQTBrowserInfoResourceType = FOUR_CHAR_CODE('brws') kQTBrowserInfoResourceVersion = 1 -kQTMediaMIMEInfoHasChanged = (1L << 1) -kQTMediaFileInfoHasChanged = (1L << 2) -kQTMediaConfigCanUseApp = (1L << 18) -kQTMediaConfigCanUsePlugin = (1L << 19) -kQTMediaConfigUNUSED = (1L << 20) -kQTMediaConfigBinaryFile = (1L << 23) +kQTMediaMIMEInfoHasChanged = (1 << 1) +kQTMediaFileInfoHasChanged = (1 << 2) +kQTMediaConfigCanUseApp = (1 << 18) +kQTMediaConfigCanUsePlugin = (1 << 19) +kQTMediaConfigUNUSED = (1 << 20) +kQTMediaConfigBinaryFile = (1 << 23) kQTMediaConfigTextFile = 0 -kQTMediaConfigMacintoshFile = (1L << 24) -kQTMediaConfigAssociateByDefault = (1L << 27) -kQTMediaConfigUseAppByDefault = (1L << 28) -kQTMediaConfigUsePluginByDefault = (1L << 29) +kQTMediaConfigMacintoshFile = (1 << 24) +kQTMediaConfigAssociateByDefault = (1 << 27) +kQTMediaConfigUseAppByDefault = (1 << 28) +kQTMediaConfigUsePluginByDefault = (1 << 29) kQTMediaConfigDefaultsMask = (kQTMediaConfigUseAppByDefault | kQTMediaConfigUsePluginByDefault) kQTMediaConfigDefaultsShift = 12 -kQTMediaConfigHasFileHasQTAtoms = (1L << 30) +kQTMediaConfigHasFileHasQTAtoms = (1 << 30) kQTMediaConfigStreamGroupID = FOUR_CHAR_CODE('strm') kQTMediaConfigInteractiveGroupID = FOUR_CHAR_CODE('intr') kQTMediaConfigVideoGroupID = FOUR_CHAR_CODE('eyes') @@ -2013,17 +2013,17 @@ kQTPresetsListResourceType = FOUR_CHAR_CODE('stg#') kQTPresetsPlatformListResourceType = FOUR_CHAR_CODE('stgp') kQTPresetInfoIsDivider = 1 kQTMovieExportSourceInfoResourceType = FOUR_CHAR_CODE('src#') -kQTMovieExportSourceInfoIsMediaType = 1L << 0 -kQTMovieExportSourceInfoIsMediaCharacteristic = 1L << 1 -kQTMovieExportSourceInfoIsSourceType = 1L << 2 +kQTMovieExportSourceInfoIsMediaType = 1 << 0 +kQTMovieExportSourceInfoIsMediaCharacteristic = 1 << 1 +kQTMovieExportSourceInfoIsSourceType = 1 << 2 movieExportUseConfiguredSettings = FOUR_CHAR_CODE('ucfg') movieExportWidth = FOUR_CHAR_CODE('wdth') movieExportHeight = FOUR_CHAR_CODE('hegt') movieExportDuration = FOUR_CHAR_CODE('dura') movieExportVideoFilter = FOUR_CHAR_CODE('iflt') movieExportTimeScale = FOUR_CHAR_CODE('tmsc') -kQTBrowserInfoCanUseSystemFolderPlugin = (1L << 0) -kQTPreFlightOpenComponent = (1L << 1) +kQTBrowserInfoCanUseSystemFolderPlugin = (1 << 0) +kQTPreFlightOpenComponent = (1 << 1) pnotComponentWantsEvents = 1 pnotComponentNeedsNoCache = 2 ShowFilePreviewComponentType = FOUR_CHAR_CODE('pnot') @@ -2032,10 +2032,10 @@ DataCompressorComponentType = FOUR_CHAR_CODE('dcom') DataDecompressorComponentType = FOUR_CHAR_CODE('ddec') AppleDataCompressorSubType = FOUR_CHAR_CODE('adec') zlibDataCompressorSubType = FOUR_CHAR_CODE('zlib') -kDataHCanRead = 1L << 0 -kDataHSpecialRead = 1L << 1 -kDataHSpecialReadFile = 1L << 2 -kDataHCanWrite = 1L << 3 +kDataHCanRead = 1 << 0 +kDataHSpecialRead = 1 << 1 +kDataHSpecialReadFile = 1 << 2 +kDataHCanWrite = 1 << 3 kDataHSpecialWrite = 1 << 4 kDataHSpecialWriteFile = 1 << 5 kDataHCanStreamingWrite = 1 << 6 @@ -2055,12 +2055,12 @@ kDataHInfoFlagNeedsNetworkBandwidth = 1 << 2 kDataHFileTypeMacOSFileType = FOUR_CHAR_CODE('ftyp') kDataHFileTypeExtension = FOUR_CHAR_CODE('fext') kDataHFileTypeMIME = FOUR_CHAR_CODE('mime') -kDataHCreateFileButDontCreateResFile = (1L << 0) -kDataHMovieUsageDoAppendMDAT = 1L << 0 -kDataHTempUseSameDirectory = 1L << 0 -kDataHTempUseSameVolume = 1L << 1 -kDataHTempCreateFile = 1L << 2 -kDataHTempOpenFile = 1L << 3 +kDataHCreateFileButDontCreateResFile = (1 << 0) +kDataHMovieUsageDoAppendMDAT = 1 << 0 +kDataHTempUseSameDirectory = 1 << 0 +kDataHTempUseSameVolume = 1 << 1 +kDataHTempCreateFile = 1 << 2 +kDataHTempOpenFile = 1 << 3 kDataHGetDataRateInfiniteRate = 0x7FFFFFFF kDataHSetTimeHintsSkipBandwidthRequest = 1 << 0 videoDigitizerComponentType = FOUR_CHAR_CODE('vdig') @@ -2091,48 +2091,48 @@ vdTypeBasic = 0 vdTypeAlpha = 1 vdTypeMask = 2 vdTypeKey = 3 -digiInDoesNTSC = 1L << 0 -digiInDoesPAL = 1L << 1 -digiInDoesSECAM = 1L << 2 -digiInDoesGenLock = 1L << 7 -digiInDoesComposite = 1L << 8 -digiInDoesSVideo = 1L << 9 -digiInDoesComponent = 1L << 10 -digiInVTR_Broadcast = 1L << 11 -digiInDoesColor = 1L << 12 -digiInDoesBW = 1L << 13 -digiInSignalLock = 1L << 31 -digiOutDoes1 = 1L << 0 -digiOutDoes2 = 1L << 1 -digiOutDoes4 = 1L << 2 -digiOutDoes8 = 1L << 3 -digiOutDoes16 = 1L << 4 -digiOutDoes32 = 1L << 5 -digiOutDoesDither = 1L << 6 -digiOutDoesStretch = 1L << 7 -digiOutDoesShrink = 1L << 8 -digiOutDoesMask = 1L << 9 -digiOutDoesDouble = 1L << 11 -digiOutDoesQuad = 1L << 12 -digiOutDoesQuarter = 1L << 13 -digiOutDoesSixteenth = 1L << 14 -digiOutDoesRotate = 1L << 15 -digiOutDoesHorizFlip = 1L << 16 -digiOutDoesVertFlip = 1L << 17 -digiOutDoesSkew = 1L << 18 -digiOutDoesBlend = 1L << 19 -digiOutDoesWarp = 1L << 20 -digiOutDoesHW_DMA = 1L << 21 -digiOutDoesHWPlayThru = 1L << 22 -digiOutDoesILUT = 1L << 23 -digiOutDoesKeyColor = 1L << 24 -digiOutDoesAsyncGrabs = 1L << 25 -digiOutDoesUnreadableScreenBits = 1L << 26 -digiOutDoesCompress = 1L << 27 -digiOutDoesCompressOnly = 1L << 28 -digiOutDoesPlayThruDuringCompress = 1L << 29 -digiOutDoesCompressPartiallyVisible = 1L << 30 -digiOutDoesNotNeedCopyOfCompressData = 1L << 31 +digiInDoesNTSC = 1 << 0 +digiInDoesPAL = 1 << 1 +digiInDoesSECAM = 1 << 2 +digiInDoesGenLock = 1 << 7 +digiInDoesComposite = 1 << 8 +digiInDoesSVideo = 1 << 9 +digiInDoesComponent = 1 << 10 +digiInVTR_Broadcast = 1 << 11 +digiInDoesColor = 1 << 12 +digiInDoesBW = 1 << 13 +digiInSignalLock = 1 << 31 +digiOutDoes1 = 1 << 0 +digiOutDoes2 = 1 << 1 +digiOutDoes4 = 1 << 2 +digiOutDoes8 = 1 << 3 +digiOutDoes16 = 1 << 4 +digiOutDoes32 = 1 << 5 +digiOutDoesDither = 1 << 6 +digiOutDoesStretch = 1 << 7 +digiOutDoesShrink = 1 << 8 +digiOutDoesMask = 1 << 9 +digiOutDoesDouble = 1 << 11 +digiOutDoesQuad = 1 << 12 +digiOutDoesQuarter = 1 << 13 +digiOutDoesSixteenth = 1 << 14 +digiOutDoesRotate = 1 << 15 +digiOutDoesHorizFlip = 1 << 16 +digiOutDoesVertFlip = 1 << 17 +digiOutDoesSkew = 1 << 18 +digiOutDoesBlend = 1 << 19 +digiOutDoesWarp = 1 << 20 +digiOutDoesHW_DMA = 1 << 21 +digiOutDoesHWPlayThru = 1 << 22 +digiOutDoesILUT = 1 << 23 +digiOutDoesKeyColor = 1 << 24 +digiOutDoesAsyncGrabs = 1 << 25 +digiOutDoesUnreadableScreenBits = 1 << 26 +digiOutDoesCompress = 1 << 27 +digiOutDoesCompressOnly = 1 << 28 +digiOutDoesPlayThruDuringCompress = 1 << 29 +digiOutDoesCompressPartiallyVisible = 1 << 30 +digiOutDoesNotNeedCopyOfCompressData = 1 << 31 dmaDepth1 = 1 dmaDepth2 = 2 dmaDepth4 = 4 @@ -2160,19 +2160,19 @@ xmlIdentifierInvalid = 0 xmlContentTypeInvalid = 0 xmlContentTypeElement = 1 xmlContentTypeCharData = 2 -elementFlagAlwaysSelfContained = 1L << 0 -elementFlagPreserveWhiteSpace = 1L << 1 -xmlParseFlagAllowUppercase = 1L << 0 -xmlParseFlagAllowUnquotedAttributeValues = 1L << 1 -xmlParseFlagEventParseOnly = 1L << 2 +elementFlagAlwaysSelfContained = 1 << 0 +elementFlagPreserveWhiteSpace = 1 << 1 +xmlParseFlagAllowUppercase = 1 << 0 +xmlParseFlagAllowUnquotedAttributeValues = 1 << 1 +xmlParseFlagEventParseOnly = 1 << 2 attributeValueKindCharString = 0 -attributeValueKindInteger = 1L << 0 -attributeValueKindPercent = 1L << 1 -attributeValueKindBoolean = 1L << 2 -attributeValueKindOnOff = 1L << 3 -attributeValueKindColor = 1L << 4 -attributeValueKindEnum = 1L << 5 -attributeValueKindCaseSensEnum = 1L << 6 +attributeValueKindInteger = 1 << 0 +attributeValueKindPercent = 1 << 1 +attributeValueKindBoolean = 1 << 2 +attributeValueKindOnOff = 1 << 3 +attributeValueKindColor = 1 << 4 +attributeValueKindEnum = 1 << 5 +attributeValueKindCaseSensEnum = 1 << 6 MAX_ATTRIBUTE_VALUE_KIND = attributeValueKindCaseSensEnum nameSpaceIDNone = 0 element_xml = 1 @@ -2267,7 +2267,7 @@ sgcVideoRectType = FOUR_CHAR_CODE('vrct') sgcVideoDigitizerType = FOUR_CHAR_CODE('vdig') QTVideoOutputComponentType = FOUR_CHAR_CODE('vout') QTVideoOutputComponentBaseSubType = FOUR_CHAR_CODE('base') -kQTVideoOutputDontDisplayToUser = 1L << 0 +kQTVideoOutputDontDisplayToUser = 1 << 0 kQTVODisplayModeItem = FOUR_CHAR_CODE('qdmi') kQTVODimensions = FOUR_CHAR_CODE('dimn') kQTVOResolution = FOUR_CHAR_CODE('resl') @@ -2801,12 +2801,12 @@ mPartialDraw = 1 << 4 mWantIdleActions = 1 << 5 forceUpdateRedraw = 1 << 0 forceUpdateNewBuffer = 1 << 1 -mHitTestBounds = 1L << 0 -mHitTestImage = 1L << 1 -mHitTestInvisible = 1L << 2 -mHitTestIsClick = 1L << 3 -mOpaque = 1L << 0 -mInvisible = 1L << 1 +mHitTestBounds = 1 << 0 +mHitTestImage = 1 << 1 +mHitTestInvisible = 1 << 2 +mHitTestIsClick = 1 << 3 +mOpaque = 1 << 0 +mInvisible = 1 << 1 kMediaQTIdleFrequencySelector = FOUR_CHAR_CODE('idfq') kMediaVideoParamBrightness = 1 kMediaVideoParamContrast = 2 @@ -3244,8 +3244,8 @@ kUndefined4EventType = 0x0000000E kGeneralEventType = 0x0000000F kXEventLengthBits = 0x00000002 kGeneralEventLengthBits = 0x00000003 -kEventLen = 1L -kXEventLen = 2L +kEventLen = 1 +kXEventLen = 2 kRestEventLen = kEventLen kNoteEventLen = kEventLen kControlEventLen = kEventLen @@ -3265,7 +3265,7 @@ kXEventPartFieldPos = 16 kXEventPartFieldWidth = 12 kRestEventDurationFieldPos = 0 kRestEventDurationFieldWidth = 24 -kRestEventDurationMax = ((1L << kRestEventDurationFieldWidth) - 1) +kRestEventDurationMax = ((1 << kRestEventDurationFieldWidth) - 1) kNoteEventPitchFieldPos = 18 kNoteEventPitchFieldWidth = 6 kNoteEventPitchOffset = 32 @@ -3274,12 +3274,12 @@ kNoteEventVolumeFieldWidth = 7 kNoteEventVolumeOffset = 0 kNoteEventDurationFieldPos = 0 kNoteEventDurationFieldWidth = 11 -kNoteEventDurationMax = ((1L << kNoteEventDurationFieldWidth) - 1) +kNoteEventDurationMax = ((1 << kNoteEventDurationFieldWidth) - 1) kXNoteEventPitchFieldPos = 0 kXNoteEventPitchFieldWidth = 16 kXNoteEventDurationFieldPos = 0 kXNoteEventDurationFieldWidth = 22 -kXNoteEventDurationMax = ((1L << kXNoteEventDurationFieldWidth) - 1) +kXNoteEventDurationMax = ((1 << kXNoteEventDurationFieldWidth) - 1) kXNoteEventVolumeFieldPos = 22 kXNoteEventVolumeFieldWidth = 7 kControlEventControllerFieldPos = 16 diff --git a/Lib/plat-mac/Carbon/Sound.py b/Lib/plat-mac/Carbon/Sound.py index 0e7b2fb..cbdb4ae 100644 --- a/Lib/plat-mac/Carbon/Sound.py +++ b/Lib/plat-mac/Carbon/Sound.py @@ -300,15 +300,15 @@ k8BitRawOut = (1 << 8) k8BitTwosOut = (1 << 9) k16BitOut = (1 << 10) kStereoOut = (1 << 11) -kReverse = (1L << 16) -kRateConvert = (1L << 17) -kCreateSoundSource = (1L << 18) -kVMAwareness = (1L << 21) -kHighQuality = (1L << 22) -kNonRealTime = (1L << 23) +kReverse = (1 << 16) +kRateConvert = (1 << 17) +kCreateSoundSource = (1 << 18) +kVMAwareness = (1 << 21) +kHighQuality = (1 << 22) +kNonRealTime = (1 << 23) kSourcePaused = (1 << 0) -kPassThrough = (1L << 16) -kNoSoundComponentChain = (1L << 17) +kPassThrough = (1 << 16) +kNoSoundComponentChain = (1 << 17) kNoMixing = (1 << 0) kNoSampleRateConversion = (1 << 1) kNoSampleSizeConversion = (1 << 2) @@ -343,9 +343,9 @@ audioLeftChannel = 1 audioRightChannel = 2 audioUnmuted = 0 audioMuted = 1 -audioDoesMono = (1L << 0) -audioDoesStereo = (1L << 1) -audioDoesIndependentChannels = (1L << 2) +audioDoesMono = (1 << 0) +audioDoesStereo = (1 << 1) +audioDoesIndependentChannels = (1 << 2) siCDQuality = FOUR_CHAR_CODE('cd ') siBestQuality = FOUR_CHAR_CODE('best') siBetterQuality = FOUR_CHAR_CODE('betr') @@ -358,8 +358,8 @@ siReadPermission = 0 siWritePermission = 1 kSoundConverterDidntFillBuffer = (1 << 0) kSoundConverterHasLeftOverData = (1 << 1) -kExtendedSoundSampleCountNotValid = 1L << 0 -kExtendedSoundBufferSizeValid = 1L << 1 +kExtendedSoundSampleCountNotValid = 1 << 0 +kExtendedSoundBufferSizeValid = 1 << 1 kScheduledSoundDoScheduled = 1 << 0 kScheduledSoundDoCallBack = 1 << 1 kScheduledSoundExtendedHdr = 1 << 2 diff --git a/Lib/plat-mac/Carbon/Windows.py b/Lib/plat-mac/Carbon/Windows.py index b09d537..9654226 100644 --- a/Lib/plat-mac/Carbon/Windows.py +++ b/Lib/plat-mac/Carbon/Windows.py @@ -20,24 +20,24 @@ kSheetAlertWindowClass = 15 kAltPlainWindowClass = 16 kDrawerWindowClass = 20 # kAllWindowClasses = (unsigned long)0xFFFFFFFF -kWindowNoAttributes = 0L -kWindowCloseBoxAttribute = (1L << 0) -kWindowHorizontalZoomAttribute = (1L << 1) -kWindowVerticalZoomAttribute = (1L << 2) +kWindowNoAttributes = 0 +kWindowCloseBoxAttribute = (1 << 0) +kWindowHorizontalZoomAttribute = (1 << 1) +kWindowVerticalZoomAttribute = (1 << 2) kWindowFullZoomAttribute = (kWindowVerticalZoomAttribute | kWindowHorizontalZoomAttribute) -kWindowCollapseBoxAttribute = (1L << 3) -kWindowResizableAttribute = (1L << 4) -kWindowSideTitlebarAttribute = (1L << 5) -kWindowToolbarButtonAttribute = (1L << 6) -kWindowNoUpdatesAttribute = (1L << 16) -kWindowNoActivatesAttribute = (1L << 17) -kWindowOpaqueForEventsAttribute = (1L << 18) -kWindowNoShadowAttribute = (1L << 21) -kWindowHideOnSuspendAttribute = (1L << 24) -kWindowStandardHandlerAttribute = (1L << 25) -kWindowHideOnFullScreenAttribute = (1L << 26) -kWindowInWindowMenuAttribute = (1L << 27) -kWindowLiveResizeAttribute = (1L << 28) +kWindowCollapseBoxAttribute = (1 << 3) +kWindowResizableAttribute = (1 << 4) +kWindowSideTitlebarAttribute = (1 << 5) +kWindowToolbarButtonAttribute = (1 << 6) +kWindowNoUpdatesAttribute = (1 << 16) +kWindowNoActivatesAttribute = (1 << 17) +kWindowOpaqueForEventsAttribute = (1 << 18) +kWindowNoShadowAttribute = (1 << 21) +kWindowHideOnSuspendAttribute = (1 << 24) +kWindowStandardHandlerAttribute = (1 << 25) +kWindowHideOnFullScreenAttribute = (1 << 26) +kWindowInWindowMenuAttribute = (1 << 27) +kWindowLiveResizeAttribute = (1 << 28) # kWindowNoConstrainAttribute = (unsigned long)((1L << 31)) kWindowStandardDocumentAttributes = (kWindowCloseBoxAttribute | kWindowFullZoomAttribute | kWindowCollapseBoxAttribute | kWindowResizableAttribute) kWindowStandardFloatingAttributes = (kWindowCloseBoxAttribute | kWindowCollapseBoxAttribute) @@ -225,7 +225,7 @@ wTitleBarColor = 4 # kMouseUpOutOfSlop = (long)0x80008000 kWindowDefinitionVersionOne = 1 kWindowDefinitionVersionTwo = 2 -kWindowIsCollapsedState = (1 << 0L) +kWindowIsCollapsedState = (1 << 0) kStoredWindowSystemTag = FOUR_CHAR_CODE('appl') kStoredBasicWindowDescriptionID = FOUR_CHAR_CODE('sbas') kStoredWindowPascalTitleID = FOUR_CHAR_CODE('s255') @@ -251,8 +251,8 @@ kWindowGroupContentsRecurse = 1 << 1 kWindowGroupContentsVisible = 1 << 2 kWindowPaintProcOptionsNone = 0 kScrollWindowNoOptions = 0 -kScrollWindowInvalidate = (1L << 0) -kScrollWindowEraseToPortBackground = (1L << 1) +kScrollWindowInvalidate = (1 << 0) +kScrollWindowEraseToPortBackground = (1 << 1) kWindowMenuIncludeRotate = 1 << 0 kWindowZoomTransitionEffect = 1 kWindowSheetTransitionEffect = 2 @@ -261,11 +261,11 @@ kWindowShowTransitionAction = 1 kWindowHideTransitionAction = 2 kWindowMoveTransitionAction = 3 kWindowResizeTransitionAction = 4 -kWindowConstrainMayResize = (1L << 0) -kWindowConstrainMoveRegardlessOfFit = (1L << 1) -kWindowConstrainAllowPartial = (1L << 2) -kWindowConstrainCalcOnly = (1L << 3) -kWindowConstrainUseTransitionWindow = (1L << 4) +kWindowConstrainMayResize = (1 << 0) +kWindowConstrainMoveRegardlessOfFit = (1 << 1) +kWindowConstrainAllowPartial = (1 << 2) +kWindowConstrainCalcOnly = (1 << 3) +kWindowConstrainUseTransitionWindow = (1 << 4) kWindowConstrainStandardOptions = kWindowConstrainMoveRegardlessOfFit kWindowLatentVisibleFloater = 1 << 0 kWindowLatentVisibleSuspend = 1 << 1 diff --git a/Lib/plat-mac/aepack.py b/Lib/plat-mac/aepack.py index f16171b..aa1734d 100644 --- a/Lib/plat-mac/aepack.py +++ b/Lib/plat-mac/aepack.py @@ -189,13 +189,13 @@ def unpack(desc, formodulename=""): return struct.unpack('l', desc.data)[0] if t == typeLongDateTime: a, b = struct.unpack('lL', desc.data) - return (long(a) << 32) + b + return (int(a) << 32) + b if t == typeNull: return None if t == typeMagnitude: v = struct.unpack('l', desc.data) if v < 0: - v = 0x100000000L + v + v = 0x100000000 + v return v if t == typeObjectSpecifier: record = desc.AECoerceDesc('reco') diff --git a/Lib/plat-mac/macfs.py b/Lib/plat-mac/macfs.py index 73815ae..6ec4bef 100644 --- a/Lib/plat-mac/macfs.py +++ b/Lib/plat-mac/macfs.py @@ -28,24 +28,24 @@ smAllScripts = -3 # Find the epoch conversion for file dates in a way that works on OS9 and OSX import time if time.gmtime(0)[0] == 1970: - _EPOCHCONVERT = -((1970-1904)*365 + 17) * (24*60*60) + 0x100000000L + _EPOCHCONVERT = -((1970-1904)*365 + 17) * (24*60*60) + 0x100000000 def _utc2time(utc): t = utc[1] + _EPOCHCONVERT return int(t) def _time2utc(t): t = int(t) - _EPOCHCONVERT if t < -0x7fffffff: - t = t + 0x10000000L + t = t + 0x10000000 return (0, int(t), 0) else: def _utc2time(utc): t = utc[1] if t < 0: - t = t + 0x100000000L + t = t + 0x100000000 return t def _time2utc(t): if t > 0x7fffffff: - t = t - 0x100000000L + t = t - 0x100000000 return (0, int(t), 0) # The old name of the error object: diff --git a/Lib/plat-mac/pimp.py b/Lib/plat-mac/pimp.py index 6927ad7..3b1a686 100644 --- a/Lib/plat-mac/pimp.py +++ b/Lib/plat-mac/pimp.py @@ -148,7 +148,7 @@ class PimpUrllibDownloader(PimpDownloader): keepgoing = True download = urllib2.urlopen(url) if "content-length" in download.headers: - length = long(download.headers['content-length']) + length = int(download.headers['content-length']) else: length = -1 diff --git a/Lib/plat-os2emx/IN.py b/Lib/plat-os2emx/IN.py index 8b06eb8..753ae24 100644 --- a/Lib/plat-os2emx/IN.py +++ b/Lib/plat-os2emx/IN.py @@ -28,33 +28,33 @@ IPPROTO_RAW = 255 IPPROTO_MAX = 256 IPPORT_RESERVED = 1024 IPPORT_USERRESERVED = 5000 -def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) +def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0) IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 24 IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_MAX = 128 -def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) +def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000) IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 16 IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_MAX = 65536 -def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) +def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000) IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 8 IN_CLASSC_HOST = 0x000000ff -def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) +def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000) IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 28 IN_CLASSD_HOST = 0x0fffffff def IN_MULTICAST(i): return IN_CLASSD(i) -def IN_EXPERIMENTAL(i): return (((long)(i) & 0xe0000000) == 0xe0000000) +def IN_EXPERIMENTAL(i): return (((int)(i) & 0xe0000000) == 0xe0000000) -def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) +def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000) INADDR_ANY = 0x00000000 INADDR_LOOPBACK = 0x7f000001 diff --git a/Lib/plat-sunos5/IN.py b/Lib/plat-sunos5/IN.py index 867b9eb..3a4971d 100755 --- a/Lib/plat-sunos5/IN.py +++ b/Lib/plat-sunos5/IN.py @@ -42,7 +42,7 @@ _LARGEFILE64_SOURCE = 1 _LARGEFILE_SOURCE = 1 _FILE_OFFSET_BITS = 64 _FILE_OFFSET_BITS = 32 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 _POSIX_PTHREAD_SEMANTICS = 1 _XOPEN_VERSION = 500 _XOPEN_VERSION = 4 @@ -95,10 +95,10 @@ NGROUPS_UMIN = 0 NGROUPS_UMAX = 32 NGROUPS_MAX_DEFAULT = 16 NZERO = 20 -NULL = 0L +NULL = 0 NULL = 0 CMASK = 022 -CDLIMIT = (1L<<11) +CDLIMIT = (1<<11) NBPS = 0x20000 NBPSCTR = 512 UBSIZE = 512 @@ -117,9 +117,9 @@ DEV_BSIZE = 512 DEV_BSHIFT = 9 MAXFRAG = 8 MAXOFF32_T = 0x7fffffff -MAXOFF_T = 0x7fffffffffffffffl -MAXOFFSET_T = 0x7fffffffffffffffl -MAXOFF_T = 0x7fffffffl +MAXOFF_T = 0x7fffffffffffffff +MAXOFFSET_T = 0x7fffffffffffffff +MAXOFF_T = 0x7fffffff MAXOFFSET_T = 0x7fffffff def btodb(bytes): return \ @@ -312,9 +312,9 @@ _PC_PRIO_IO = 11 _PC_SYNC_IO = 12 _PC_FILESIZEBITS = 67 _PC_LAST = 67 -_POSIX_VERSION = 199506L -_POSIX2_VERSION = 199209L -_POSIX2_C_VERSION = 199209L +_POSIX_VERSION = 199506 +_POSIX2_VERSION = 199209 +_POSIX2_C_VERSION = 199209 _XOPEN_XCU_VERSION = 4 _XOPEN_REALTIME = 1 _XOPEN_ENH_I18N = 1 @@ -431,7 +431,7 @@ def TIMESTRUC_TO_TICK(tsp): return \ from TYPES import * # Included from iso/time_iso.h -NULL = 0L +NULL = 0 NULL = 0 CLOCKS_PER_SEC = 1000000 @@ -869,9 +869,9 @@ RLIMIT_NOFILE = 5 RLIMIT_VMEM = 6 RLIMIT_AS = RLIMIT_VMEM RLIM_NLIMITS = 7 -RLIM_INFINITY = (-3l) -RLIM_SAVED_MAX = (-2l) -RLIM_SAVED_CUR = (-1l) +RLIM_INFINITY = (-3) +RLIM_SAVED_MAX = (-2) +RLIM_SAVED_CUR = (-1) RLIM_INFINITY = 0x7fffffff RLIM_SAVED_MAX = 0x7ffffffe RLIM_SAVED_CUR = 0x7ffffffd @@ -1063,7 +1063,7 @@ POLLNOERR = 0x0400 POLLCLOSED = 0x8000 # Included from sys/strmdep.h -def str_aligned(X): return (((ulong_t)(X) & (sizeof (long) - 1)) == 0) +def str_aligned(X): return (((ulong_t)(X) & (sizeof (int) - 1)) == 0) # Included from sys/strft.h diff --git a/Lib/plat-sunos5/STROPTS.py b/Lib/plat-sunos5/STROPTS.py index 4970bd7..b72f4e6 100644 --- a/Lib/plat-sunos5/STROPTS.py +++ b/Lib/plat-sunos5/STROPTS.py @@ -42,7 +42,7 @@ _LARGEFILE64_SOURCE = 1 _LARGEFILE_SOURCE = 1 _FILE_OFFSET_BITS = 64 _FILE_OFFSET_BITS = 32 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 _POSIX_PTHREAD_SEMANTICS = 1 _XOPEN_VERSION = 500 _XOPEN_VERSION = 4 @@ -92,10 +92,10 @@ NGROUPS_UMIN = 0 NGROUPS_UMAX = 32 NGROUPS_MAX_DEFAULT = 16 NZERO = 20 -NULL = 0L +NULL = 0 NULL = 0 CMASK = 022 -CDLIMIT = (1L<<11) +CDLIMIT = (1<<11) NBPS = 0x20000 NBPSCTR = 512 UBSIZE = 512 @@ -114,9 +114,9 @@ DEV_BSIZE = 512 DEV_BSHIFT = 9 MAXFRAG = 8 MAXOFF32_T = 0x7fffffff -MAXOFF_T = 0x7fffffffffffffffl -MAXOFFSET_T = 0x7fffffffffffffffl -MAXOFF_T = 0x7fffffffl +MAXOFF_T = 0x7fffffffffffffff +MAXOFFSET_T = 0x7fffffffffffffff +MAXOFF_T = 0x7fffffff MAXOFFSET_T = 0x7fffffff def btodb(bytes): return \ @@ -309,9 +309,9 @@ _PC_PRIO_IO = 11 _PC_SYNC_IO = 12 _PC_FILESIZEBITS = 67 _PC_LAST = 67 -_POSIX_VERSION = 199506L -_POSIX2_VERSION = 199209L -_POSIX2_C_VERSION = 199209L +_POSIX_VERSION = 199506 +_POSIX2_VERSION = 199209 +_POSIX2_C_VERSION = 199209 _XOPEN_XCU_VERSION = 4 _XOPEN_REALTIME = 1 _XOPEN_ENH_I18N = 1 @@ -428,7 +428,7 @@ def TIMESTRUC_TO_TICK(tsp): return \ from TYPES import * # Included from iso/time_iso.h -NULL = 0L +NULL = 0 NULL = 0 CLOCKS_PER_SEC = 1000000 @@ -872,9 +872,9 @@ RLIMIT_NOFILE = 5 RLIMIT_VMEM = 6 RLIMIT_AS = RLIMIT_VMEM RLIM_NLIMITS = 7 -RLIM_INFINITY = (-3l) -RLIM_SAVED_MAX = (-2l) -RLIM_SAVED_CUR = (-1l) +RLIM_INFINITY = (-3) +RLIM_SAVED_MAX = (-2) +RLIM_SAVED_CUR = (-1) RLIM_INFINITY = 0x7fffffff RLIM_SAVED_MAX = 0x7ffffffe RLIM_SAVED_CUR = 0x7ffffffd diff --git a/Lib/plat-sunos5/TYPES.py b/Lib/plat-sunos5/TYPES.py index e8e4a00..da4e6b1 100644 --- a/Lib/plat-sunos5/TYPES.py +++ b/Lib/plat-sunos5/TYPES.py @@ -42,7 +42,7 @@ _LARGEFILE64_SOURCE = 1 _LARGEFILE_SOURCE = 1 _FILE_OFFSET_BITS = 64 _FILE_OFFSET_BITS = 32 -_POSIX_C_SOURCE = 199506L +_POSIX_C_SOURCE = 199506 _POSIX_PTHREAD_SEMANTICS = 1 _XOPEN_VERSION = 500 _XOPEN_VERSION = 4 @@ -216,10 +216,10 @@ SHRT_MAX = 32767 USHRT_MAX = 65535 INT_MIN = (-2147483647-1) INT_MAX = 2147483647 -LONG_MIN = (-9223372036854775807L-1L) -LONG_MAX = 9223372036854775807L -LONG_MIN = (-2147483647L-1L) -LONG_MAX = 2147483647L +LONG_MIN = (-9223372036854775807-1) +LONG_MAX = 9223372036854775807 +LONG_MIN = (-2147483647-1) +LONG_MAX = 2147483647 P_MYID = (-1) # Included from sys/select.h @@ -303,7 +303,7 @@ def TIMESTRUC_TO_TICK(tsp): return \ from TYPES import * # Included from iso/time_iso.h -NULL = 0L +NULL = 0 NULL = 0 CLOCKS_PER_SEC = 1000000 FD_SETSIZE = 65536 diff --git a/Lib/plat-unixware7/IN.py b/Lib/plat-unixware7/IN.py index d66ae97..514456e 100644 --- a/Lib/plat-unixware7/IN.py +++ b/Lib/plat-unixware7/IN.py @@ -1,33 +1,33 @@ # Generated by h2py from /usr/include/netinet/in.h # Included from netinet/in_f.h -def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0) +def IN_CLASSA(i): return (((int)(i) & 0x80000000) == 0) IN_CLASSA_NET = 0xff000000 IN_CLASSA_NSHIFT = 24 IN_CLASSA_HOST = 0x00ffffff IN_CLASSA_MAX = 128 -def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000) +def IN_CLASSB(i): return (((int)(i) & 0xc0000000) == 0x80000000) IN_CLASSB_NET = 0xffff0000 IN_CLASSB_NSHIFT = 16 IN_CLASSB_HOST = 0x0000ffff IN_CLASSB_MAX = 65536 -def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000) +def IN_CLASSC(i): return (((int)(i) & 0xe0000000) == 0xc0000000) IN_CLASSC_NET = 0xffffff00 IN_CLASSC_NSHIFT = 8 IN_CLASSC_HOST = 0x000000ff -def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000) +def IN_CLASSD(i): return (((int)(i) & 0xf0000000) == 0xe0000000) IN_CLASSD_NET = 0xf0000000 IN_CLASSD_NSHIFT = 28 IN_CLASSD_HOST = 0x0fffffff def IN_MULTICAST(i): return IN_CLASSD(i) -def IN_EXPERIMENTAL(i): return (((long)(i) & 0xe0000000) == 0xe0000000) +def IN_EXPERIMENTAL(i): return (((int)(i) & 0xe0000000) == 0xe0000000) -def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000) +def IN_BADCLASS(i): return (((int)(i) & 0xf0000000) == 0xf0000000) INADDR_ANY = 0x00000000 INADDR_LOOPBACK = 0x7f000001 @@ -330,7 +330,7 @@ MSG_TRUNC = 0x10 MSG_EOR = 0x30 MSG_WAITALL = 0x20 MSG_MAXIOVLEN = 16 -def OPTLEN(x): return ((((x) + sizeof(long) - 1) / sizeof(long)) * sizeof(long)) +def OPTLEN(x): return ((((x) + sizeof(int) - 1) / sizeof(int)) * sizeof(int)) GIARG = 0x1 CONTI = 0x2 @@ -715,7 +715,7 @@ FLUSHDATA = 0 STRHIGH = 5120 STRLOW = 1024 MAXIOCBSZ = 1024 -def straln(a): return (caddr_t)((long)(a) & ~(sizeof(int)-1)) +def straln(a): return (caddr_t)((int)(a) & ~(sizeof(int)-1)) IPM_ID = 200 ICMPM_ID = 201 diff --git a/Lib/plat-unixware7/STROPTS.py b/Lib/plat-unixware7/STROPTS.py index 0f0cb25..9850eb4 100644 --- a/Lib/plat-unixware7/STROPTS.py +++ b/Lib/plat-unixware7/STROPTS.py @@ -213,7 +213,7 @@ _PC_NO_TRUNC = 7 _PC_VDISABLE = 8 _PC_CHOWN_RESTRICTED = 9 _PC_FILESIZEBITS = 10 -_POSIX_VERSION = 199009L +_POSIX_VERSION = 199009 _XOPEN_VERSION = 4 GF_PATH = "/etc/group" PF_PATH = "/etc/passwd" @@ -231,8 +231,8 @@ STDERR_FILENO = 2 _XOPEN_UNIX = 1 _XOPEN_ENH_I18N = 1 _XOPEN_XPG4 = 1 -_POSIX2_C_VERSION = 199209L -_POSIX2_VERSION = 199209L +_POSIX2_C_VERSION = 199209 +_POSIX2_VERSION = 199209 _XOPEN_XCU_VERSION = 4 _POSIX_SEMAPHORES = 1 _POSIX_THREADS = 1 diff --git a/Lib/platform.py b/Lib/platform.py index ba24b28..77bce40 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -682,7 +682,7 @@ def mac_ver(release='',versioninfo=('','',''),machine=''): patch = (sysv & 0x000F) release = '%s.%i.%i' % (_bcd2str(major),minor,patch) if sysu: - major = int((sysu & 0xFF000000L) >> 24) + major = int((sysu & 0xFF000000) >> 24) minor = (sysu & 0x00F00000) >> 20 bugfix = (sysu & 0x000F0000) >> 16 stage = (sysu & 0x0000FF00) >> 8 diff --git a/Lib/py_compile.py b/Lib/py_compile.py index 23c5d18..8f44982 100644 --- a/Lib/py_compile.py +++ b/Lib/py_compile.py @@ -114,9 +114,9 @@ def compile(file, cfile=None, dfile=None, doraise=False): """ f = open(file, 'U') try: - timestamp = long(os.fstat(f.fileno()).st_mtime) + timestamp = int(os.fstat(f.fileno()).st_mtime) except AttributeError: - timestamp = long(os.stat(file).st_mtime) + timestamp = int(os.stat(file).st_mtime) codestring = f.read() f.close() if codestring and codestring[-1] != '\n': diff --git a/Lib/random.py b/Lib/random.py index b80f1a1..0a65400 100644 --- a/Lib/random.py +++ b/Lib/random.py @@ -105,10 +105,10 @@ class Random(_random.Random): if a is None: try: - a = long(_hexlify(_urandom(16)), 16) + a = int(_hexlify(_urandom(16)), 16) except NotImplementedError: import time - a = long(time.time() * 256) # use fractional seconds + a = int(time.time() * 256) # use fractional seconds super(Random, self).seed(a) self.gauss_next = None @@ -145,7 +145,7 @@ class Random(_random.Random): ## -------------------- integer methods ------------------- def randrange(self, start, stop=None, step=1, int=int, default=None, - maxwidth=1L<<BPF): + maxwidth=1<<BPF): """Choose a random item from range(start, stop[, step]). This fixes the problem with randint() which includes the @@ -214,7 +214,7 @@ class Random(_random.Random): return self.randrange(a, b+1) - def _randbelow(self, n, _log=_log, int=int, _maxwidth=1L<<BPF, + def _randbelow(self, n, _log=_log, int=int, _maxwidth=1<<BPF, _Method=_MethodType, _BuiltinMethod=_BuiltinMethodType): """Return a random int in the range [0,n) @@ -626,12 +626,12 @@ class WichmannHill(Random): if a is None: try: - a = long(_hexlify(_urandom(16)), 16) + a = int(_hexlify(_urandom(16)), 16) except NotImplementedError: import time - a = long(time.time() * 256) # use fractional seconds + a = int(time.time() * 256) # use fractional seconds - if not isinstance(a, (int, long)): + if not isinstance(a, (int, int)): a = hash(a) a, x = divmod(a, 30268) @@ -721,7 +721,7 @@ class WichmannHill(Random): if 0 == x == y == z: # Initialize from current time import time - t = long(time.time() * 256) + t = int(time.time() * 256) t = int((t&0xffffff) ^ (t>>24)) t, x = divmod(t, 256) t, y = divmod(t, 256) @@ -766,7 +766,7 @@ class SystemRandom(Random): def random(self): """Get the next random number in the range [0.0, 1.0).""" - return (long(_hexlify(_urandom(7)), 16) >> 3) * RECIP_BPF + return (int(_hexlify(_urandom(7)), 16) >> 3) * RECIP_BPF def getrandbits(self, k): """getrandbits(k) -> x. Generates a long int with k random bits.""" @@ -775,7 +775,7 @@ class SystemRandom(Random): if k != int(k): raise TypeError('number of bits should be an integer') bytes = (k + 7) // 8 # bits / 8 and rounded up - x = long(_hexlify(_urandom(bytes)), 16) + x = int(_hexlify(_urandom(bytes)), 16) return x >> (bytes * 8 - k) # trim excess bits def _stub(self, *args, **kwds): diff --git a/Lib/sre_compile.py b/Lib/sre_compile.py index 1d448da..f6cbd7b 100644 --- a/Lib/sre_compile.py +++ b/Lib/sre_compile.py @@ -19,7 +19,7 @@ assert _sre.MAGIC == MAGIC, "SRE module mismatch" if _sre.CODESIZE == 2: MAXCODE = 65535 else: - MAXCODE = 0xFFFFFFFFL + MAXCODE = 0xFFFFFFFF def _identityfunction(x): return x @@ -267,7 +267,7 @@ def _mk_bitmap(bits): if _sre.CODESIZE == 2: start = (1, 0) else: - start = (1L, 0L) + start = (1, 0) m, v = start for c in bits: if c: diff --git a/Lib/sre_parse.py b/Lib/sre_parse.py index e63f2ac..2b3064b 100644 --- a/Lib/sre_parse.py +++ b/Lib/sre_parse.py @@ -149,7 +149,7 @@ class SubPattern: # determine the width (min, max) for this subpattern if self.width: return self.width - lo = hi = 0L + lo = hi = 0 UNITCODES = (ANY, RANGE, IN, LITERAL, NOT_LITERAL, CATEGORY) REPEATCODES = (MIN_REPEAT, MAX_REPEAT) for op, av in self.data: @@ -172,8 +172,8 @@ class SubPattern: hi = hi + j elif op in REPEATCODES: i, j = av[2].getwidth() - lo = lo + long(i) * av[0] - hi = hi + long(j) * av[1] + lo = lo + int(i) * av[0] + hi = hi + int(j) * av[1] elif op in UNITCODES: lo = lo + 1 hi = hi + 1 diff --git a/Lib/string.py b/Lib/string.py index 921bd8b..8281936 100644 --- a/Lib/string.py +++ b/Lib/string.py @@ -374,7 +374,7 @@ def rfind(s, *args): # for a bit of speed _float = float _int = int -_long = long +_long = int # Convert string to float def atof(s): diff --git a/Lib/stringold.py b/Lib/stringold.py index 69656be..8388b07 100644 --- a/Lib/stringold.py +++ b/Lib/stringold.py @@ -184,7 +184,7 @@ def rfind(s, *args): # for a bit of speed _float = float _int = int -_long = long +_long = int _StringType = type('') # Convert string to float diff --git a/Lib/subprocess.py b/Lib/subprocess.py index 6656890..14f56f7 100644 --- a/Lib/subprocess.py +++ b/Lib/subprocess.py @@ -541,7 +541,7 @@ class Popen(object): _cleanup() self._child_created = False - if not isinstance(bufsize, (int, long)): + if not isinstance(bufsize, (int, int)): raise TypeError("bufsize must be an integer") if mswindows: @@ -764,7 +764,7 @@ class Popen(object): startupinfo.wShowWindow = SW_HIDE comspec = os.environ.get("COMSPEC", "cmd.exe") args = comspec + " /c " + args - if (GetVersion() >= 0x80000000L or + if (GetVersion() >= 0x80000000 or os.path.basename(comspec).lower() == "command.com"): # Win9x, or using command.com on NT. We need to # use the w9xpopen intermediate program. For more diff --git a/Lib/sunau.py b/Lib/sunau.py index 0a40295..ba79508 100644 --- a/Lib/sunau.py +++ b/Lib/sunau.py @@ -119,7 +119,7 @@ AUDIO_FILE_ENCODING_ADPCM_G723_5 = 26 AUDIO_FILE_ENCODING_ALAW_8 = 27 # from <multimedia/audio_hdr.h> -AUDIO_UNKNOWN_SIZE = 0xFFFFFFFFL # ((unsigned)(~0)) +AUDIO_UNKNOWN_SIZE = 0xFFFFFFFF # ((unsigned)(~0)) _simple_encodings = [AUDIO_FILE_ENCODING_MULAW_8, AUDIO_FILE_ENCODING_LINEAR_8, @@ -132,7 +132,7 @@ class Error(Exception): pass def _read_u32(file): - x = 0L + x = 0 for i in range(4): byte = file.read(1) if byte == '': diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 2088e5c..64e1f88 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -80,7 +80,7 @@ VERSION = "00" # version number LENGTH_NAME = 100 # maximum length of a filename LENGTH_LINK = 100 # maximum length of a linkname LENGTH_PREFIX = 155 # maximum length of the prefix field -MAXSIZE_MEMBER = 077777777777L # maximum size of a file (11 octal digits) +MAXSIZE_MEMBER = 077777777777 # maximum size of a file (11 octal digits) REGTYPE = "0" # regular file AREGTYPE = "\0" # regular file @@ -152,7 +152,7 @@ def nti(s): except ValueError: raise HeaderError("invalid header") else: - n = 0L + n = 0 for i in xrange(len(s) - 1): n <<= 8 n += ord(s[i + 1]) @@ -347,7 +347,7 @@ class _Stream: self.fileobj = fileobj self.bufsize = bufsize self.buf = "" - self.pos = 0L + self.pos = 0 self.closed = False if comptype == "gz": @@ -384,7 +384,7 @@ class _Stream: -self.zlib.MAX_WBITS, self.zlib.DEF_MEM_LEVEL, 0) - timestamp = struct.pack("<L", long(time.time())) + timestamp = struct.pack("<L", int(time.time())) self.__write("\037\213\010\010%s\002\377" % timestamp) if self.name.endswith(".gz"): self.name = self.name[:-3] @@ -429,8 +429,8 @@ class _Stream: # while the same crc on a 64-bit box may "look positive". # To avoid irksome warnings from the `struct` module, force # it to look positive on all boxes. - self.fileobj.write(struct.pack("<L", self.crc & 0xffffffffL)) - self.fileobj.write(struct.pack("<L", self.pos & 0xffffFFFFL)) + self.fileobj.write(struct.pack("<L", self.crc & 0xffffffff)) + self.fileobj.write(struct.pack("<L", self.pos & 0xffffFFFF)) if not self._extfileobj: self.fileobj.close() @@ -1076,7 +1076,7 @@ class TarFile(object): self.closed = False self.members = [] # list of members as TarInfo objects self._loaded = False # flag if all members have been read - self.offset = 0L # current position in the archive file + self.offset = 0 # current position in the archive file self.inodes = {} # dictionary caching the inodes of # archive members already added @@ -1378,7 +1378,7 @@ class TarFile(object): if stat.S_ISREG(stmd): tarinfo.size = statres.st_size else: - tarinfo.size = 0L + tarinfo.size = 0 tarinfo.mtime = statres.st_mtime tarinfo.type = type tarinfo.linkname = linkname @@ -1924,8 +1924,8 @@ class TarFile(object): buf = tarinfo.buf sp = _ringbuffer() pos = 386 - lastpos = 0L - realpos = 0L + lastpos = 0 + realpos = 0 # There are 4 possible sparse structs in the # first header. for i in xrange(4): diff --git a/Lib/test/list_tests.py b/Lib/test/list_tests.py index fc1a6c3..3867be5 100644 --- a/Lib/test/list_tests.py +++ b/Lib/test/list_tests.py @@ -99,16 +99,16 @@ class CommonTest(seq_tests.CommonTest): self.assertRaises(TypeError, a.__setitem__) a = self.type2test([0,1,2,3,4]) - a[0L] = 1 - a[1L] = 2 - a[2L] = 3 + a[0] = 1 + a[1] = 2 + a[2] = 3 self.assertEqual(a, self.type2test([1,2,3,3,4])) a[0] = 5 a[1] = 6 a[2] = 7 self.assertEqual(a, self.type2test([5,6,7,3,4])) - a[-2L] = 88 - a[-1L] = 99 + a[-2] = 88 + a[-1] = 99 self.assertEqual(a, self.type2test([5,6,7,88,99])) a[-2] = 8 a[-1] = 9 @@ -189,8 +189,8 @@ class CommonTest(seq_tests.CommonTest): self.assertEqual(a, self.type2test([])) a = self.type2test([0, 1]) - del a[1L:2L] - del a[0L:1L] + del a[1:2] + del a[0:1] self.assertEqual(a, self.type2test([])) a = self.type2test([0, 1]) @@ -198,7 +198,7 @@ class CommonTest(seq_tests.CommonTest): self.assertEqual(a, self.type2test([1])) a = self.type2test([0, 1]) - del a[-2L:-1L] + del a[-2:-1] self.assertEqual(a, self.type2test([1])) a = self.type2test([0, 1]) @@ -207,8 +207,8 @@ class CommonTest(seq_tests.CommonTest): self.assertEqual(a, self.type2test([])) a = self.type2test([0, 1]) - del a[1L:] - del a[:1L] + del a[1:] + del a[:1] self.assertEqual(a, self.type2test([])) a = self.type2test([0, 1]) @@ -216,7 +216,7 @@ class CommonTest(seq_tests.CommonTest): self.assertEqual(a, self.type2test([0])) a = self.type2test([0, 1]) - del a[-1L:] + del a[-1:] self.assertEqual(a, self.type2test([0])) a = self.type2test([0, 1]) diff --git a/Lib/test/mapping_tests.py b/Lib/test/mapping_tests.py index 15f9add..6b872c4 100644 --- a/Lib/test/mapping_tests.py +++ b/Lib/test/mapping_tests.py @@ -526,7 +526,7 @@ class TestMappingProtocol(BasicTestMappingProtocol): # verify longs/ints get same value when key > 32 bits (for 64-bit archs) # see SF bug #689659 - x = 4503599627370496L + x = 4503599627370496 y = 4503599627370496 h = self._full_mapping({x: 'anything', y: 'something else'}) self.assertEqual(h[x], h[y]) @@ -626,7 +626,7 @@ class TestHashMappingProtocol(TestMappingProtocol): def test_eq(self): self.assertEqual(self._empty_mapping(), self._empty_mapping()) self.assertEqual(self._full_mapping({1: 2}), - self._full_mapping({1L: 2L})) + self._full_mapping({1: 2})) class Exc(Exception): pass diff --git a/Lib/test/pickletester.py b/Lib/test/pickletester.py index 0f1386e..5d340b3 100644 --- a/Lib/test/pickletester.py +++ b/Lib/test/pickletester.py @@ -349,7 +349,7 @@ def create_data(): c = C() c.foo = 1 c.bar = 2 - x = [0, 1L, 2.0, 3.0+0j] + x = [0, 1, 2.0, 3.0+0j] # Append some integer test cases at cPickle.c's internal size # cutoffs. uint1max = 0xff @@ -504,7 +504,7 @@ class AbstractPickleTests(unittest.TestCase): n = n >> 1 def test_maxint64(self): - maxint64 = (1L << 63) - 1 + maxint64 = (1 << 63) - 1 data = 'I' + str(maxint64) + '\n.' got = self.loads(data) self.assertEqual(got, maxint64) @@ -517,7 +517,7 @@ class AbstractPickleTests(unittest.TestCase): for proto in protocols: # 256 bytes is where LONG4 begins. for nbits in 1, 8, 8*254, 8*255, 8*256, 8*257: - nbase = 1L << nbits + nbase = 1 << nbits for npos in nbase-1, nbase, nbase+1: for n in npos, -npos: pickle = self.dumps(n, proto) @@ -525,7 +525,7 @@ class AbstractPickleTests(unittest.TestCase): self.assertEqual(n, got) # Try a monster. This is quadratic-time in protos 0 & 1, so don't # bother with those. - nbase = long("deadbeeffeedface", 16) + nbase = int("deadbeeffeedface", 16) nbase += nbase << 1000000 for n in nbase, -nbase: p = self.dumps(n, 2) @@ -592,7 +592,7 @@ class AbstractPickleTests(unittest.TestCase): self.fail("expected bad protocol number to raise ValueError") def test_long1(self): - x = 12345678910111213141516178920L + x = 12345678910111213141516178920 for proto in protocols: s = self.dumps(x, proto) y = self.loads(s) @@ -600,7 +600,7 @@ class AbstractPickleTests(unittest.TestCase): self.assertEqual(opcode_in_pickle(pickle.LONG1, s), proto >= 2) def test_long4(self): - x = 12345678910111213141516178920L << (256*8) + x = 12345678910111213141516178920 << (256*8) for proto in protocols: s = self.dumps(x, proto) y = self.loads(s) @@ -864,8 +864,8 @@ class REX_three(object): class MyInt(int): sample = 1 -class MyLong(long): - sample = 1L +class MyLong(int): + sample = 1 class MyFloat(float): sample = 1.0 diff --git a/Lib/test/regrtest.py b/Lib/test/regrtest.py index ce39649..4517c59 100755 --- a/Lib/test/regrtest.py +++ b/Lib/test/regrtest.py @@ -1324,7 +1324,7 @@ class _ExpectedSkips: if test_timeout.skip_expected: self.expected.add('test_timeout') - if sys.maxint == 9223372036854775807L: + if sys.maxint == 9223372036854775807: self.expected.add('test_rgbimg') self.expected.add('test_imageop') diff --git a/Lib/test/seq_tests.py b/Lib/test/seq_tests.py index 18fb3b7..0dfe7e4 100644 --- a/Lib/test/seq_tests.py +++ b/Lib/test/seq_tests.py @@ -138,10 +138,10 @@ class CommonTest(unittest.TestCase): u = self.type2test([0, 1, 2, 3, 4]) for i in xrange(len(u)): self.assertEqual(u[i], i) - self.assertEqual(u[long(i)], i) + self.assertEqual(u[int(i)], i) for i in xrange(-len(u), -1): self.assertEqual(u[i], len(u)+i) - self.assertEqual(u[long(i)], len(u)+i) + self.assertEqual(u[int(i)], len(u)+i) self.assertRaises(IndexError, u.__getitem__, -len(u)-1) self.assertRaises(IndexError, u.__getitem__, len(u)) self.assertRaises(ValueError, u.__getitem__, slice(0,10,0)) @@ -189,12 +189,12 @@ class CommonTest(unittest.TestCase): self.assertEqual(u[-100:100:], u) self.assertEqual(u[100:-100:-1], u[::-1]) self.assertEqual(u[-100:100:-1], self.type2test([])) - self.assertEqual(u[-100L:100L:2L], self.type2test([0, 2, 4])) + self.assertEqual(u[-100:100:2], self.type2test([0, 2, 4])) # Test extreme cases with long ints a = self.type2test([0,1,2,3,4]) - self.assertEqual(a[ -pow(2,128L): 3 ], self.type2test([0,1,2])) - self.assertEqual(a[ 3: pow(2,145L) ], self.type2test([3,4])) + self.assertEqual(a[ -pow(2,128): 3 ], self.type2test([0,1,2])) + self.assertEqual(a[ 3: pow(2,145) ], self.type2test([3,4])) self.assertRaises(TypeError, u.__getslice__) @@ -254,16 +254,16 @@ class CommonTest(unittest.TestCase): self.assertEqual(self.type2test([-1]) + u1, self.type2test([-1, 0])) self.assertEqual(self.type2test(), u2*0) self.assertEqual(self.type2test(), 0*u2) - self.assertEqual(self.type2test(), u2*0L) - self.assertEqual(self.type2test(), 0L*u2) + self.assertEqual(self.type2test(), u2*0) + self.assertEqual(self.type2test(), 0*u2) + self.assertEqual(u2, u2*1) + self.assertEqual(u2, 1*u2) self.assertEqual(u2, u2*1) self.assertEqual(u2, 1*u2) - self.assertEqual(u2, u2*1L) - self.assertEqual(u2, 1L*u2) self.assertEqual(u2+u2, u2*2) self.assertEqual(u2+u2, 2*u2) - self.assertEqual(u2+u2, u2*2L) - self.assertEqual(u2+u2, 2L*u2) + self.assertEqual(u2+u2, u2*2) + self.assertEqual(u2+u2, 2*u2) self.assertEqual(u2+u2+u2, u2*3) self.assertEqual(u2+u2+u2, 3*u2) @@ -308,10 +308,10 @@ class CommonTest(unittest.TestCase): def test_subscript(self): a = self.type2test([10, 11]) - self.assertEqual(a.__getitem__(0L), 10) - self.assertEqual(a.__getitem__(1L), 11) - self.assertEqual(a.__getitem__(-2L), 10) - self.assertEqual(a.__getitem__(-1L), 11) + self.assertEqual(a.__getitem__(0), 10) + self.assertEqual(a.__getitem__(1), 11) + self.assertEqual(a.__getitem__(-2), 10) + self.assertEqual(a.__getitem__(-1), 11) self.assertRaises(IndexError, a.__getitem__, -3) self.assertRaises(IndexError, a.__getitem__, 3) self.assertEqual(a.__getitem__(slice(0,1)), self.type2test([10])) diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py index 2116ea4..17e3389 100644 --- a/Lib/test/string_tests.py +++ b/Lib/test/string_tests.py @@ -12,7 +12,7 @@ class Sequence: def __getitem__(self, i): return self.seq[i] class BadSeq1(Sequence): - def __init__(self): self.seq = [7, 'hello', 123L] + def __init__(self): self.seq = [7, 'hello', 123] class BadSeq2(Sequence): def __init__(self): self.seq = ['a', 'b', 'c'] @@ -902,7 +902,7 @@ class MixinStrUnicodeUserStringTest: def test_subscript(self): self.checkequal(u'a', 'abc', '__getitem__', 0) self.checkequal(u'c', 'abc', '__getitem__', -1) - self.checkequal(u'a', 'abc', '__getitem__', 0L) + self.checkequal(u'a', 'abc', '__getitem__', 0) self.checkequal(u'abc', 'abc', '__getitem__', slice(0, 3)) self.checkequal(u'abc', 'abc', '__getitem__', slice(0, 1000)) self.checkequal(u'a', 'abc', '__getitem__', slice(0, 1)) @@ -965,7 +965,7 @@ class MixinStrUnicodeUserStringTest: self.checkraises(TypeError, ' ', 'join') self.checkraises(TypeError, ' ', 'join', 7) - self.checkraises(TypeError, ' ', 'join', Sequence([7, 'hello', 123L])) + self.checkraises(TypeError, ' ', 'join', Sequence([7, 'hello', 123])) try: def f(): yield 4 + "" diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py index 5c79b48..17d494c 100755 --- a/Lib/test/test_array.py +++ b/Lib/test/test_array.py @@ -61,7 +61,7 @@ class BaseTest(unittest.TestCase): bi = a.buffer_info() self.assert_(isinstance(bi, tuple)) self.assertEqual(len(bi), 2) - self.assert_(isinstance(bi[0], (int, long))) + self.assert_(isinstance(bi[0], (int, int))) self.assert_(isinstance(bi[1], int)) self.assertEqual(bi[1], len(a)) @@ -323,9 +323,9 @@ class BaseTest(unittest.TestCase): def test_getitem(self): a = array.array(self.typecode, self.example) self.assertEntryEqual(a[0], self.example[0]) - self.assertEntryEqual(a[0L], self.example[0]) + self.assertEntryEqual(a[0], self.example[0]) + self.assertEntryEqual(a[-1], self.example[-1]) self.assertEntryEqual(a[-1], self.example[-1]) - self.assertEntryEqual(a[-1L], self.example[-1]) self.assertEntryEqual(a[len(self.example)-1], self.example[-1]) self.assertEntryEqual(a[-len(self.example)], self.example[0]) self.assertRaises(TypeError, a.__getitem__) @@ -338,7 +338,7 @@ class BaseTest(unittest.TestCase): self.assertEntryEqual(a[0], a[-1]) a = array.array(self.typecode, self.example) - a[0L] = a[-1] + a[0] = a[-1] self.assertEntryEqual(a[0], a[-1]) a = array.array(self.typecode, self.example) @@ -346,7 +346,7 @@ class BaseTest(unittest.TestCase): self.assertEntryEqual(a[0], a[-1]) a = array.array(self.typecode, self.example) - a[-1L] = a[0] + a[-1] = a[0] self.assertEntryEqual(a[0], a[-1]) a = array.array(self.typecode, self.example) @@ -777,7 +777,7 @@ class NumberTest(BaseTest): self.assertEqual(a[3::-2], array.array(self.typecode, [3,1])) self.assertEqual(a[-100:100:], a) self.assertEqual(a[100:-100:-1], a[::-1]) - self.assertEqual(a[-100L:100L:2L], array.array(self.typecode, [0,2,4])) + self.assertEqual(a[-100:100:2], array.array(self.typecode, [0,2,4])) self.assertEqual(a[1000:2000:2], array.array(self.typecode, [])) self.assertEqual(a[-1000:-2000:-2], array.array(self.typecode, [])) @@ -863,8 +863,8 @@ class SignedNumberTest(NumberTest): def test_overflow(self): a = array.array(self.typecode) - lower = -1 * long(pow(2, a.itemsize * 8 - 1)) - upper = long(pow(2, a.itemsize * 8 - 1)) - 1L + lower = -1 * int(pow(2, a.itemsize * 8 - 1)) + upper = int(pow(2, a.itemsize * 8 - 1)) - 1 self.check_overflow(lower, upper) class UnsignedNumberTest(NumberTest): @@ -876,7 +876,7 @@ class UnsignedNumberTest(NumberTest): def test_overflow(self): a = array.array(self.typecode) lower = 0 - upper = long(pow(2, a.itemsize * 8)) - 1L + upper = int(pow(2, a.itemsize * 8)) - 1 self.check_overflow(lower, upper) diff --git a/Lib/test/test_ast.py b/Lib/test/test_ast.py index 914f1d9..289b533 100644 --- a/Lib/test/test_ast.py +++ b/Lib/test/test_ast.py @@ -2,7 +2,7 @@ import sys, itertools import _ast def to_tuple(t): - if t is None or isinstance(t, (basestring, int, long, complex)): + if t is None or isinstance(t, (basestring, int, int, complex)): return t elif isinstance(t, list): return [to_tuple(e) for e in t] @@ -93,7 +93,7 @@ eval_tests = [ # Call "f(1,2,c=3,*d,**e)", # Num - "10L", + "10", # Str "'string'", # Attribute diff --git a/Lib/test/test_asynchat.py b/Lib/test/test_asynchat.py index 9926167..6bcedd6 100644 --- a/Lib/test/test_asynchat.py +++ b/Lib/test/test_asynchat.py @@ -77,7 +77,7 @@ class TestAsynchat(unittest.TestCase): s = echo_server() s.start() time.sleep(1) # Give server time to initialize - c = echo_client(6L) + c = echo_client(6) c.push("hello ") c.push("world\n") asyncore.loop() diff --git a/Lib/test/test_bigmem.py b/Lib/test/test_bigmem.py index 6d6c37c..5d2d844 100644 --- a/Lib/test/test_bigmem.py +++ b/Lib/test/test_bigmem.py @@ -866,13 +866,13 @@ class ListTest(unittest.TestCase): @bigmemtest(minsize=_2G // 5 + 2, memuse=8 * 5) def test_index(self, size): - l = [1L, 2L, 3L, 4L, 5L] * size + l = [1, 2, 3, 4, 5] * size size *= 5 self.assertEquals(l.index(1), 0) self.assertEquals(l.index(5, size - 5), size - 1) self.assertEquals(l.index(5, size - 5, size), size - 1) self.assertRaises(ValueError, l.index, 1, size - 4, size) - self.assertRaises(ValueError, l.index, 6L) + self.assertRaises(ValueError, l.index, 6) # This tests suffers from overallocation, just like test_append. @bigmemtest(minsize=_2G + 10, memuse=9) diff --git a/Lib/test/test_binop.py b/Lib/test/test_binop.py index ccce207..5aeb118 100644 --- a/Lib/test/test_binop.py +++ b/Lib/test/test_binop.py @@ -11,11 +11,11 @@ def gcd(a, b): def isint(x): """Test whether an object is an instance of int or long.""" - return isinstance(x, int) or isinstance(x, long) + return isinstance(x, int) or isinstance(x, int) def isnum(x): """Test whether an object is an instance of a built-in numeric type.""" - for T in int, long, float, complex: + for T in int, int, float, complex: if isinstance(x, T): return 1 return 0 @@ -30,7 +30,7 @@ class Rat(object): __slots__ = ['_Rat__num', '_Rat__den'] - def __init__(self, num=0L, den=1L): + def __init__(self, num=0, den=1): """Constructor: Rat([num[, den]]). The arguments must be ints or longs, and default to (0, 1).""" @@ -42,8 +42,8 @@ class Rat(object): if den == 0: raise ZeroDivisionError, "zero denominator" g = gcd(den, num) - self.__num = long(num//g) - self.__den = long(den//g) + self.__num = int(num//g) + self.__den = int(den//g) def _get_num(self): """Accessor function for read-only 'num' attribute of Rat.""" @@ -80,7 +80,7 @@ class Rat(object): def __long__(self): """Convert a Rat to an long; self.den must be 1.""" if self.__den == 1: - return long(self.__num) + return int(self.__num) raise ValueError, "can't convert %s to long" % repr(self) def __add__(self, other): @@ -225,7 +225,7 @@ class RatTestCase(unittest.TestCase): a = Rat(10, 15) self.assertEqual(a.num, 2) self.assertEqual(a.den, 3) - a = Rat(10L, 15L) + a = Rat(10, 15) self.assertEqual(a.num, 2) self.assertEqual(a.den, 3) a = Rat(10, -15) diff --git a/Lib/test/test_builtin.py b/Lib/test/test_builtin.py index fb859d4..56417a3 100644 --- a/Lib/test/test_builtin.py +++ b/Lib/test/test_builtin.py @@ -122,9 +122,9 @@ class BuiltinTest(unittest.TestCase): self.assertEqual(abs(3.14), 3.14) self.assertEqual(abs(-3.14), 3.14) # long - self.assertEqual(abs(0L), 0L) - self.assertEqual(abs(1234L), 1234L) - self.assertEqual(abs(-1234L), 1234L) + self.assertEqual(abs(0), 0) + self.assertEqual(abs(1234), 1234) + self.assertEqual(abs(-1234), 1234) # str self.assertRaises(TypeError, abs, 'a') @@ -235,15 +235,15 @@ class BuiltinTest(unittest.TestCase): self.assertEqual(divmod(12, -7), (-2, -2)) self.assertEqual(divmod(-12, -7), (1, -5)) - self.assertEqual(divmod(12L, 7L), (1L, 5L)) - self.assertEqual(divmod(-12L, 7L), (-2L, 2L)) - self.assertEqual(divmod(12L, -7L), (-2L, -2L)) - self.assertEqual(divmod(-12L, -7L), (1L, -5L)) + self.assertEqual(divmod(12, 7), (1, 5)) + self.assertEqual(divmod(-12, 7), (-2, 2)) + self.assertEqual(divmod(12, -7), (-2, -2)) + self.assertEqual(divmod(-12, -7), (1, -5)) - self.assertEqual(divmod(12, 7L), (1, 5L)) - self.assertEqual(divmod(-12, 7L), (-2, 2L)) - self.assertEqual(divmod(12L, -7), (-2L, -2)) - self.assertEqual(divmod(-12L, -7), (1L, -5)) + self.assertEqual(divmod(12, 7), (1, 5)) + self.assertEqual(divmod(-12, 7), (-2, 2)) + self.assertEqual(divmod(12, -7), (-2, -2)) + self.assertEqual(divmod(-12, -7), (1, -5)) self.assertEqual(divmod(-sys.maxint-1, -1), (sys.maxint+1, 0)) @@ -538,7 +538,7 @@ class BuiltinTest(unittest.TestCase): def test_float(self): self.assertEqual(float(3.14), 3.14) self.assertEqual(float(314), 314.0) - self.assertEqual(float(314L), 314.0) + self.assertEqual(float(314), 314.0) self.assertEqual(float(" 3.14 "), 3.14) self.assertRaises(ValueError, float, " 0x3.1 ") self.assertRaises(ValueError, float, " -0x3.p-1 ") @@ -624,7 +624,7 @@ class BuiltinTest(unittest.TestCase): def test_hash(self): hash(None) - self.assertEqual(hash(1), hash(1L)) + self.assertEqual(hash(1), hash(1)) self.assertEqual(hash(1), hash(1.0)) hash('spam') if have_unicode: @@ -642,22 +642,22 @@ class BuiltinTest(unittest.TestCase): def __hash__(self): return 2**100 self.assertEquals(type(hash(Y())), int) - class Z(long): + class Z(int): def __hash__(self): return self - self.assertEquals(hash(Z(42)), hash(42L)) + self.assertEquals(hash(Z(42)), hash(42)) def test_hex(self): self.assertEqual(hex(16), '0x10') - self.assertEqual(hex(16L), '0x10') + self.assertEqual(hex(16), '0x10') + self.assertEqual(hex(-16), '-0x10') self.assertEqual(hex(-16), '-0x10') - self.assertEqual(hex(-16L), '-0x10') self.assertRaises(TypeError, hex, {}) def test_id(self): id(None) id(1) - id(1L) + id(1) id(1.0) id('spam') id((0,1,2,3)) @@ -667,7 +667,7 @@ class BuiltinTest(unittest.TestCase): def test_int(self): self.assertEqual(int(314), 314) self.assertEqual(int(3.14), 3) - self.assertEqual(int(314L), 314) + self.assertEqual(int(314), 314) # Check that conversion from float truncates towards zero self.assertEqual(int(-3.14), -3) self.assertEqual(int(3.9), 3) @@ -675,9 +675,9 @@ class BuiltinTest(unittest.TestCase): self.assertEqual(int(3.5), 3) self.assertEqual(int(-3.5), -3) # Different base: - self.assertEqual(int("10",16), 16L) + self.assertEqual(int("10",16), 16) if have_unicode: - self.assertEqual(int(unicode("10"),16), 16L) + self.assertEqual(int(unicode("10"),16), 16) # Test conversion from strings and various anomalies for s, v in L: for sign in "", "+", "-": @@ -700,9 +700,9 @@ class BuiltinTest(unittest.TestCase): # should return long x = int(1e100) - self.assert_(isinstance(x, long)) + self.assert_(isinstance(x, int)) x = int(-1e100) - self.assert_(isinstance(x, long)) + self.assert_(isinstance(x, int)) # SF bug 434186: 0x80000000/2 != 0x80000000>>1. @@ -720,11 +720,11 @@ class BuiltinTest(unittest.TestCase): self.assertRaises(ValueError, int, '123\x00 245', 20) x = int('1' * 600) - self.assert_(isinstance(x, long)) + self.assert_(isinstance(x, int)) if have_unicode: x = int(unichr(0x661) * 600) - self.assert_(isinstance(x, long)) + self.assert_(isinstance(x, int)) self.assertRaises(TypeError, int, 1, 12) @@ -735,79 +735,79 @@ class BuiltinTest(unittest.TestCase): # Various representations of 2**32 evaluated to 0 # rather than 2**32 in previous versions - self.assertEqual(int('100000000000000000000000000000000', 2), 4294967296L) - self.assertEqual(int('102002022201221111211', 3), 4294967296L) - self.assertEqual(int('10000000000000000', 4), 4294967296L) - self.assertEqual(int('32244002423141', 5), 4294967296L) - self.assertEqual(int('1550104015504', 6), 4294967296L) - self.assertEqual(int('211301422354', 7), 4294967296L) - self.assertEqual(int('40000000000', 8), 4294967296L) - self.assertEqual(int('12068657454', 9), 4294967296L) - self.assertEqual(int('4294967296', 10), 4294967296L) - self.assertEqual(int('1904440554', 11), 4294967296L) - self.assertEqual(int('9ba461594', 12), 4294967296L) - self.assertEqual(int('535a79889', 13), 4294967296L) - self.assertEqual(int('2ca5b7464', 14), 4294967296L) - self.assertEqual(int('1a20dcd81', 15), 4294967296L) - self.assertEqual(int('100000000', 16), 4294967296L) - self.assertEqual(int('a7ffda91', 17), 4294967296L) - self.assertEqual(int('704he7g4', 18), 4294967296L) - self.assertEqual(int('4f5aff66', 19), 4294967296L) - self.assertEqual(int('3723ai4g', 20), 4294967296L) - self.assertEqual(int('281d55i4', 21), 4294967296L) - self.assertEqual(int('1fj8b184', 22), 4294967296L) - self.assertEqual(int('1606k7ic', 23), 4294967296L) - self.assertEqual(int('mb994ag', 24), 4294967296L) - self.assertEqual(int('hek2mgl', 25), 4294967296L) - self.assertEqual(int('dnchbnm', 26), 4294967296L) - self.assertEqual(int('b28jpdm', 27), 4294967296L) - self.assertEqual(int('8pfgih4', 28), 4294967296L) - self.assertEqual(int('76beigg', 29), 4294967296L) - self.assertEqual(int('5qmcpqg', 30), 4294967296L) - self.assertEqual(int('4q0jto4', 31), 4294967296L) - self.assertEqual(int('4000000', 32), 4294967296L) - self.assertEqual(int('3aokq94', 33), 4294967296L) - self.assertEqual(int('2qhxjli', 34), 4294967296L) - self.assertEqual(int('2br45qb', 35), 4294967296L) - self.assertEqual(int('1z141z4', 36), 4294967296L) + self.assertEqual(int('100000000000000000000000000000000', 2), 4294967296) + self.assertEqual(int('102002022201221111211', 3), 4294967296) + self.assertEqual(int('10000000000000000', 4), 4294967296) + self.assertEqual(int('32244002423141', 5), 4294967296) + self.assertEqual(int('1550104015504', 6), 4294967296) + self.assertEqual(int('211301422354', 7), 4294967296) + self.assertEqual(int('40000000000', 8), 4294967296) + self.assertEqual(int('12068657454', 9), 4294967296) + self.assertEqual(int('4294967296', 10), 4294967296) + self.assertEqual(int('1904440554', 11), 4294967296) + self.assertEqual(int('9ba461594', 12), 4294967296) + self.assertEqual(int('535a79889', 13), 4294967296) + self.assertEqual(int('2ca5b7464', 14), 4294967296) + self.assertEqual(int('1a20dcd81', 15), 4294967296) + self.assertEqual(int('100000000', 16), 4294967296) + self.assertEqual(int('a7ffda91', 17), 4294967296) + self.assertEqual(int('704he7g4', 18), 4294967296) + self.assertEqual(int('4f5aff66', 19), 4294967296) + self.assertEqual(int('3723ai4g', 20), 4294967296) + self.assertEqual(int('281d55i4', 21), 4294967296) + self.assertEqual(int('1fj8b184', 22), 4294967296) + self.assertEqual(int('1606k7ic', 23), 4294967296) + self.assertEqual(int('mb994ag', 24), 4294967296) + self.assertEqual(int('hek2mgl', 25), 4294967296) + self.assertEqual(int('dnchbnm', 26), 4294967296) + self.assertEqual(int('b28jpdm', 27), 4294967296) + self.assertEqual(int('8pfgih4', 28), 4294967296) + self.assertEqual(int('76beigg', 29), 4294967296) + self.assertEqual(int('5qmcpqg', 30), 4294967296) + self.assertEqual(int('4q0jto4', 31), 4294967296) + self.assertEqual(int('4000000', 32), 4294967296) + self.assertEqual(int('3aokq94', 33), 4294967296) + self.assertEqual(int('2qhxjli', 34), 4294967296) + self.assertEqual(int('2br45qb', 35), 4294967296) + self.assertEqual(int('1z141z4', 36), 4294967296) # SF bug 1334662: int(string, base) wrong answers # Checks for proper evaluation of 2**32 + 1 - self.assertEqual(int('100000000000000000000000000000001', 2), 4294967297L) - self.assertEqual(int('102002022201221111212', 3), 4294967297L) - self.assertEqual(int('10000000000000001', 4), 4294967297L) - self.assertEqual(int('32244002423142', 5), 4294967297L) - self.assertEqual(int('1550104015505', 6), 4294967297L) - self.assertEqual(int('211301422355', 7), 4294967297L) - self.assertEqual(int('40000000001', 8), 4294967297L) - self.assertEqual(int('12068657455', 9), 4294967297L) - self.assertEqual(int('4294967297', 10), 4294967297L) - self.assertEqual(int('1904440555', 11), 4294967297L) - self.assertEqual(int('9ba461595', 12), 4294967297L) - self.assertEqual(int('535a7988a', 13), 4294967297L) - self.assertEqual(int('2ca5b7465', 14), 4294967297L) - self.assertEqual(int('1a20dcd82', 15), 4294967297L) - self.assertEqual(int('100000001', 16), 4294967297L) - self.assertEqual(int('a7ffda92', 17), 4294967297L) - self.assertEqual(int('704he7g5', 18), 4294967297L) - self.assertEqual(int('4f5aff67', 19), 4294967297L) - self.assertEqual(int('3723ai4h', 20), 4294967297L) - self.assertEqual(int('281d55i5', 21), 4294967297L) - self.assertEqual(int('1fj8b185', 22), 4294967297L) - self.assertEqual(int('1606k7id', 23), 4294967297L) - self.assertEqual(int('mb994ah', 24), 4294967297L) - self.assertEqual(int('hek2mgm', 25), 4294967297L) - self.assertEqual(int('dnchbnn', 26), 4294967297L) - self.assertEqual(int('b28jpdn', 27), 4294967297L) - self.assertEqual(int('8pfgih5', 28), 4294967297L) - self.assertEqual(int('76beigh', 29), 4294967297L) - self.assertEqual(int('5qmcpqh', 30), 4294967297L) - self.assertEqual(int('4q0jto5', 31), 4294967297L) - self.assertEqual(int('4000001', 32), 4294967297L) - self.assertEqual(int('3aokq95', 33), 4294967297L) - self.assertEqual(int('2qhxjlj', 34), 4294967297L) - self.assertEqual(int('2br45qc', 35), 4294967297L) - self.assertEqual(int('1z141z5', 36), 4294967297L) + self.assertEqual(int('100000000000000000000000000000001', 2), 4294967297) + self.assertEqual(int('102002022201221111212', 3), 4294967297) + self.assertEqual(int('10000000000000001', 4), 4294967297) + self.assertEqual(int('32244002423142', 5), 4294967297) + self.assertEqual(int('1550104015505', 6), 4294967297) + self.assertEqual(int('211301422355', 7), 4294967297) + self.assertEqual(int('40000000001', 8), 4294967297) + self.assertEqual(int('12068657455', 9), 4294967297) + self.assertEqual(int('4294967297', 10), 4294967297) + self.assertEqual(int('1904440555', 11), 4294967297) + self.assertEqual(int('9ba461595', 12), 4294967297) + self.assertEqual(int('535a7988a', 13), 4294967297) + self.assertEqual(int('2ca5b7465', 14), 4294967297) + self.assertEqual(int('1a20dcd82', 15), 4294967297) + self.assertEqual(int('100000001', 16), 4294967297) + self.assertEqual(int('a7ffda92', 17), 4294967297) + self.assertEqual(int('704he7g5', 18), 4294967297) + self.assertEqual(int('4f5aff67', 19), 4294967297) + self.assertEqual(int('3723ai4h', 20), 4294967297) + self.assertEqual(int('281d55i5', 21), 4294967297) + self.assertEqual(int('1fj8b185', 22), 4294967297) + self.assertEqual(int('1606k7id', 23), 4294967297) + self.assertEqual(int('mb994ah', 24), 4294967297) + self.assertEqual(int('hek2mgm', 25), 4294967297) + self.assertEqual(int('dnchbnn', 26), 4294967297) + self.assertEqual(int('b28jpdn', 27), 4294967297) + self.assertEqual(int('8pfgih5', 28), 4294967297) + self.assertEqual(int('76beigh', 29), 4294967297) + self.assertEqual(int('5qmcpqh', 30), 4294967297) + self.assertEqual(int('4q0jto5', 31), 4294967297) + self.assertEqual(int('4000001', 32), 4294967297) + self.assertEqual(int('3aokq95', 33), 4294967297) + self.assertEqual(int('2qhxjlj', 34), 4294967297) + self.assertEqual(int('2br45qc', 35), 4294967297) + self.assertEqual(int('1z141z5', 36), 4294967297) def test_intconversion(self): # Test __int__() @@ -829,7 +829,7 @@ class BuiltinTest(unittest.TestCase): class Foo4(int): def __int__(self): - return 42L + return 42 class Foo5(int): def __int__(self): @@ -839,7 +839,7 @@ class BuiltinTest(unittest.TestCase): self.assertEqual(int(Foo1()), 42) self.assertEqual(int(Foo2()), 42) self.assertEqual(int(Foo3()), 0) - self.assertEqual(int(Foo4()), 42L) + self.assertEqual(int(Foo4()), 42) self.assertRaises(TypeError, int, Foo5()) def test_iter(self): @@ -935,32 +935,32 @@ class BuiltinTest(unittest.TestCase): self.assertEqual(x, []) def test_long(self): - self.assertEqual(long(314), 314L) - self.assertEqual(long(3.14), 3L) - self.assertEqual(long(314L), 314L) + self.assertEqual(int(314), 314) + self.assertEqual(int(3.14), 3) + self.assertEqual(int(314), 314) # Check that conversion from float truncates towards zero - self.assertEqual(long(-3.14), -3L) - self.assertEqual(long(3.9), 3L) - self.assertEqual(long(-3.9), -3L) - self.assertEqual(long(3.5), 3L) - self.assertEqual(long(-3.5), -3L) - self.assertEqual(long("-3"), -3L) + self.assertEqual(int(-3.14), -3) + self.assertEqual(int(3.9), 3) + self.assertEqual(int(-3.9), -3) + self.assertEqual(int(3.5), 3) + self.assertEqual(int(-3.5), -3) + self.assertEqual(int("-3"), -3) if have_unicode: - self.assertEqual(long(unicode("-3")), -3L) + self.assertEqual(int(unicode("-3")), -3) # Different base: - self.assertEqual(long("10",16), 16L) + self.assertEqual(int("10",16), 16) if have_unicode: - self.assertEqual(long(unicode("10"),16), 16L) + self.assertEqual(int(unicode("10"),16), 16) # Check conversions from string (same test set as for int(), and then some) LL = [ - ('1' + '0'*20, 10L**20), - ('1' + '0'*100, 10L**100) + ('1' + '0'*20, 10**20), + ('1' + '0'*100, 10**100) ] L2 = L[:] if have_unicode: L2 += [ - (unicode('1') + unicode('0')*20, 10L**20), - (unicode('1') + unicode('0')*100, 10L**100), + (unicode('1') + unicode('0')*20, 10**20), + (unicode('1') + unicode('0')*100, 10**100), ] for s, v in L2 + LL: for sign in "", "+", "-": @@ -970,120 +970,120 @@ class BuiltinTest(unittest.TestCase): if sign == "-" and v is not ValueError: vv = -v try: - self.assertEqual(long(ss), long(vv)) + self.assertEqual(int(ss), int(vv)) except v: pass - self.assertRaises(ValueError, long, '123\0') - self.assertRaises(ValueError, long, '53', 40) - self.assertRaises(TypeError, long, 1, 12) + self.assertRaises(ValueError, int, '123\0') + self.assertRaises(ValueError, int, '53', 40) + self.assertRaises(TypeError, int, 1, 12) - self.assertEqual(long('100000000000000000000000000000000', 2), + self.assertEqual(int('100000000000000000000000000000000', 2), 4294967296) - self.assertEqual(long('102002022201221111211', 3), 4294967296) - self.assertEqual(long('10000000000000000', 4), 4294967296) - self.assertEqual(long('32244002423141', 5), 4294967296) - self.assertEqual(long('1550104015504', 6), 4294967296) - self.assertEqual(long('211301422354', 7), 4294967296) - self.assertEqual(long('40000000000', 8), 4294967296) - self.assertEqual(long('12068657454', 9), 4294967296) - self.assertEqual(long('4294967296', 10), 4294967296) - self.assertEqual(long('1904440554', 11), 4294967296) - self.assertEqual(long('9ba461594', 12), 4294967296) - self.assertEqual(long('535a79889', 13), 4294967296) - self.assertEqual(long('2ca5b7464', 14), 4294967296) - self.assertEqual(long('1a20dcd81', 15), 4294967296) - self.assertEqual(long('100000000', 16), 4294967296) - self.assertEqual(long('a7ffda91', 17), 4294967296) - self.assertEqual(long('704he7g4', 18), 4294967296) - self.assertEqual(long('4f5aff66', 19), 4294967296) - self.assertEqual(long('3723ai4g', 20), 4294967296) - self.assertEqual(long('281d55i4', 21), 4294967296) - self.assertEqual(long('1fj8b184', 22), 4294967296) - self.assertEqual(long('1606k7ic', 23), 4294967296) - self.assertEqual(long('mb994ag', 24), 4294967296) - self.assertEqual(long('hek2mgl', 25), 4294967296) - self.assertEqual(long('dnchbnm', 26), 4294967296) - self.assertEqual(long('b28jpdm', 27), 4294967296) - self.assertEqual(long('8pfgih4', 28), 4294967296) - self.assertEqual(long('76beigg', 29), 4294967296) - self.assertEqual(long('5qmcpqg', 30), 4294967296) - self.assertEqual(long('4q0jto4', 31), 4294967296) - self.assertEqual(long('4000000', 32), 4294967296) - self.assertEqual(long('3aokq94', 33), 4294967296) - self.assertEqual(long('2qhxjli', 34), 4294967296) - self.assertEqual(long('2br45qb', 35), 4294967296) - self.assertEqual(long('1z141z4', 36), 4294967296) - - self.assertEqual(long('100000000000000000000000000000001', 2), + self.assertEqual(int('102002022201221111211', 3), 4294967296) + self.assertEqual(int('10000000000000000', 4), 4294967296) + self.assertEqual(int('32244002423141', 5), 4294967296) + self.assertEqual(int('1550104015504', 6), 4294967296) + self.assertEqual(int('211301422354', 7), 4294967296) + self.assertEqual(int('40000000000', 8), 4294967296) + self.assertEqual(int('12068657454', 9), 4294967296) + self.assertEqual(int('4294967296', 10), 4294967296) + self.assertEqual(int('1904440554', 11), 4294967296) + self.assertEqual(int('9ba461594', 12), 4294967296) + self.assertEqual(int('535a79889', 13), 4294967296) + self.assertEqual(int('2ca5b7464', 14), 4294967296) + self.assertEqual(int('1a20dcd81', 15), 4294967296) + self.assertEqual(int('100000000', 16), 4294967296) + self.assertEqual(int('a7ffda91', 17), 4294967296) + self.assertEqual(int('704he7g4', 18), 4294967296) + self.assertEqual(int('4f5aff66', 19), 4294967296) + self.assertEqual(int('3723ai4g', 20), 4294967296) + self.assertEqual(int('281d55i4', 21), 4294967296) + self.assertEqual(int('1fj8b184', 22), 4294967296) + self.assertEqual(int('1606k7ic', 23), 4294967296) + self.assertEqual(int('mb994ag', 24), 4294967296) + self.assertEqual(int('hek2mgl', 25), 4294967296) + self.assertEqual(int('dnchbnm', 26), 4294967296) + self.assertEqual(int('b28jpdm', 27), 4294967296) + self.assertEqual(int('8pfgih4', 28), 4294967296) + self.assertEqual(int('76beigg', 29), 4294967296) + self.assertEqual(int('5qmcpqg', 30), 4294967296) + self.assertEqual(int('4q0jto4', 31), 4294967296) + self.assertEqual(int('4000000', 32), 4294967296) + self.assertEqual(int('3aokq94', 33), 4294967296) + self.assertEqual(int('2qhxjli', 34), 4294967296) + self.assertEqual(int('2br45qb', 35), 4294967296) + self.assertEqual(int('1z141z4', 36), 4294967296) + + self.assertEqual(int('100000000000000000000000000000001', 2), 4294967297) - self.assertEqual(long('102002022201221111212', 3), 4294967297) - self.assertEqual(long('10000000000000001', 4), 4294967297) - self.assertEqual(long('32244002423142', 5), 4294967297) - self.assertEqual(long('1550104015505', 6), 4294967297) - self.assertEqual(long('211301422355', 7), 4294967297) - self.assertEqual(long('40000000001', 8), 4294967297) - self.assertEqual(long('12068657455', 9), 4294967297) - self.assertEqual(long('4294967297', 10), 4294967297) - self.assertEqual(long('1904440555', 11), 4294967297) - self.assertEqual(long('9ba461595', 12), 4294967297) - self.assertEqual(long('535a7988a', 13), 4294967297) - self.assertEqual(long('2ca5b7465', 14), 4294967297) - self.assertEqual(long('1a20dcd82', 15), 4294967297) - self.assertEqual(long('100000001', 16), 4294967297) - self.assertEqual(long('a7ffda92', 17), 4294967297) - self.assertEqual(long('704he7g5', 18), 4294967297) - self.assertEqual(long('4f5aff67', 19), 4294967297) - self.assertEqual(long('3723ai4h', 20), 4294967297) - self.assertEqual(long('281d55i5', 21), 4294967297) - self.assertEqual(long('1fj8b185', 22), 4294967297) - self.assertEqual(long('1606k7id', 23), 4294967297) - self.assertEqual(long('mb994ah', 24), 4294967297) - self.assertEqual(long('hek2mgm', 25), 4294967297) - self.assertEqual(long('dnchbnn', 26), 4294967297) - self.assertEqual(long('b28jpdn', 27), 4294967297) - self.assertEqual(long('8pfgih5', 28), 4294967297) - self.assertEqual(long('76beigh', 29), 4294967297) - self.assertEqual(long('5qmcpqh', 30), 4294967297) - self.assertEqual(long('4q0jto5', 31), 4294967297) - self.assertEqual(long('4000001', 32), 4294967297) - self.assertEqual(long('3aokq95', 33), 4294967297) - self.assertEqual(long('2qhxjlj', 34), 4294967297) - self.assertEqual(long('2br45qc', 35), 4294967297) - self.assertEqual(long('1z141z5', 36), 4294967297) + self.assertEqual(int('102002022201221111212', 3), 4294967297) + self.assertEqual(int('10000000000000001', 4), 4294967297) + self.assertEqual(int('32244002423142', 5), 4294967297) + self.assertEqual(int('1550104015505', 6), 4294967297) + self.assertEqual(int('211301422355', 7), 4294967297) + self.assertEqual(int('40000000001', 8), 4294967297) + self.assertEqual(int('12068657455', 9), 4294967297) + self.assertEqual(int('4294967297', 10), 4294967297) + self.assertEqual(int('1904440555', 11), 4294967297) + self.assertEqual(int('9ba461595', 12), 4294967297) + self.assertEqual(int('535a7988a', 13), 4294967297) + self.assertEqual(int('2ca5b7465', 14), 4294967297) + self.assertEqual(int('1a20dcd82', 15), 4294967297) + self.assertEqual(int('100000001', 16), 4294967297) + self.assertEqual(int('a7ffda92', 17), 4294967297) + self.assertEqual(int('704he7g5', 18), 4294967297) + self.assertEqual(int('4f5aff67', 19), 4294967297) + self.assertEqual(int('3723ai4h', 20), 4294967297) + self.assertEqual(int('281d55i5', 21), 4294967297) + self.assertEqual(int('1fj8b185', 22), 4294967297) + self.assertEqual(int('1606k7id', 23), 4294967297) + self.assertEqual(int('mb994ah', 24), 4294967297) + self.assertEqual(int('hek2mgm', 25), 4294967297) + self.assertEqual(int('dnchbnn', 26), 4294967297) + self.assertEqual(int('b28jpdn', 27), 4294967297) + self.assertEqual(int('8pfgih5', 28), 4294967297) + self.assertEqual(int('76beigh', 29), 4294967297) + self.assertEqual(int('5qmcpqh', 30), 4294967297) + self.assertEqual(int('4q0jto5', 31), 4294967297) + self.assertEqual(int('4000001', 32), 4294967297) + self.assertEqual(int('3aokq95', 33), 4294967297) + self.assertEqual(int('2qhxjlj', 34), 4294967297) + self.assertEqual(int('2br45qc', 35), 4294967297) + self.assertEqual(int('1z141z5', 36), 4294967297) def test_longconversion(self): # Test __long__() class Foo0: def __long__(self): - return 42L + return 42 class Foo1(object): def __long__(self): - return 42L + return 42 - class Foo2(long): + class Foo2(int): def __long__(self): - return 42L + return 42 - class Foo3(long): + class Foo3(int): def __long__(self): return self - class Foo4(long): + class Foo4(int): def __long__(self): return 42 - class Foo5(long): + class Foo5(int): def __long__(self): return 42. - self.assertEqual(long(Foo0()), 42L) - self.assertEqual(long(Foo1()), 42L) + self.assertEqual(int(Foo0()), 42) + self.assertEqual(int(Foo1()), 42) # XXX invokes __int__ now # self.assertEqual(long(Foo2()), 42L) - self.assertEqual(long(Foo3()), 0) + self.assertEqual(int(Foo3()), 0) # XXX likewise # self.assertEqual(long(Foo4()), 42) # self.assertRaises(TypeError, long, Foo5()) @@ -1174,9 +1174,9 @@ class BuiltinTest(unittest.TestCase): self.assertEqual(max((1, 2, 3, 1, 2, 3)), 3) self.assertEqual(max([1, 2, 3, 1, 2, 3]), 3) - self.assertEqual(max(1, 2L, 3.0), 3.0) - self.assertEqual(max(1L, 2.0, 3), 3) - self.assertEqual(max(1.0, 2, 3L), 3L) + self.assertEqual(max(1, 2, 3.0), 3.0) + self.assertEqual(max(1, 2.0, 3), 3) + self.assertEqual(max(1.0, 2, 3), 3) for stmt in ( "max(key=int)", # no args @@ -1208,9 +1208,9 @@ class BuiltinTest(unittest.TestCase): self.assertEqual(min((1, 2, 3, 1, 2, 3)), 1) self.assertEqual(min([1, 2, 3, 1, 2, 3]), 1) - self.assertEqual(min(1, 2L, 3.0), 1) - self.assertEqual(min(1L, 2.0, 3), 1L) - self.assertEqual(min(1.0, 2, 3L), 1.0) + self.assertEqual(min(1, 2, 3.0), 1) + self.assertEqual(min(1, 2.0, 3), 1) + self.assertEqual(min(1.0, 2, 3), 1.0) self.assertRaises(TypeError, min) self.assertRaises(TypeError, min, 42) @@ -1250,9 +1250,9 @@ class BuiltinTest(unittest.TestCase): def test_oct(self): self.assertEqual(oct(100), '0144') - self.assertEqual(oct(100L), '0144') + self.assertEqual(oct(100), '0144') + self.assertEqual(oct(-100), '-0144') self.assertEqual(oct(-100), '-0144') - self.assertEqual(oct(-100L), '-0144') self.assertRaises(TypeError, oct, ()) def write_testfile(self): @@ -1309,20 +1309,20 @@ class BuiltinTest(unittest.TestCase): self.assertEqual(pow(-2,2), 4) self.assertEqual(pow(-2,3), -8) - self.assertEqual(pow(0L,0), 1) - self.assertEqual(pow(0L,1), 0) - self.assertEqual(pow(1L,0), 1) - self.assertEqual(pow(1L,1), 1) + self.assertEqual(pow(0,0), 1) + self.assertEqual(pow(0,1), 0) + self.assertEqual(pow(1,0), 1) + self.assertEqual(pow(1,1), 1) - self.assertEqual(pow(2L,0), 1) - self.assertEqual(pow(2L,10), 1024) - self.assertEqual(pow(2L,20), 1024*1024) - self.assertEqual(pow(2L,30), 1024*1024*1024) + self.assertEqual(pow(2,0), 1) + self.assertEqual(pow(2,10), 1024) + self.assertEqual(pow(2,20), 1024*1024) + self.assertEqual(pow(2,30), 1024*1024*1024) - self.assertEqual(pow(-2L,0), 1) - self.assertEqual(pow(-2L,1), -2) - self.assertEqual(pow(-2L,2), 4) - self.assertEqual(pow(-2L,3), -8) + self.assertEqual(pow(-2,0), 1) + self.assertEqual(pow(-2,1), -2) + self.assertEqual(pow(-2,2), 4) + self.assertEqual(pow(-2,3), -8) self.assertAlmostEqual(pow(0.,0), 1.) self.assertAlmostEqual(pow(0.,1), 0.) @@ -1339,9 +1339,9 @@ class BuiltinTest(unittest.TestCase): self.assertAlmostEqual(pow(-2.,2), 4.) self.assertAlmostEqual(pow(-2.,3), -8.) - for x in 2, 2L, 2.0: - for y in 10, 10L, 10.0: - for z in 1000, 1000L, 1000.0: + for x in 2, 2, 2.0: + for y in 10, 10, 10.0: + for z in 1000, 1000, 1000.0: if isinstance(x, float) or \ isinstance(y, float) or \ isinstance(z, float): @@ -1351,8 +1351,8 @@ class BuiltinTest(unittest.TestCase): self.assertRaises(TypeError, pow, -1, -2, 3) self.assertRaises(ValueError, pow, 1, 2, 0) - self.assertRaises(TypeError, pow, -1L, -2L, 3L) - self.assertRaises(ValueError, pow, 1L, 2L, 0L) + self.assertRaises(TypeError, pow, -1, -2, 3) + self.assertRaises(ValueError, pow, 1, 2, 0) self.assertRaises(ValueError, pow, -342.43, 0.234) self.assertRaises(TypeError, pow) @@ -1371,12 +1371,12 @@ class BuiltinTest(unittest.TestCase): self.assertEqual(range(0, 2**100, -1), []) self.assertEqual(range(0, 2**100, -1), []) - a = long(10 * sys.maxint) - b = long(100 * sys.maxint) - c = long(50 * sys.maxint) + a = int(10 * sys.maxint) + b = int(100 * sys.maxint) + c = int(50 * sys.maxint) self.assertEqual(range(a, a+2), [a, a+1]) - self.assertEqual(range(a+2, a, -1L), [a+2, a+1]) + self.assertEqual(range(a+2, a, -1), [a+2, a+1]) self.assertEqual(range(a+4, a, -2), [a+4, a+2]) seq = range(a, b, c) @@ -1397,7 +1397,7 @@ class BuiltinTest(unittest.TestCase): self.assertRaises(TypeError, range) self.assertRaises(TypeError, range, 1, 2, 3, 4) self.assertRaises(ValueError, range, 1, 2, 0) - self.assertRaises(ValueError, range, a, a + 1, long(0)) + self.assertRaises(ValueError, range, a, a + 1, int(0)) class badzero(int): def __eq__(self, other): @@ -1428,7 +1428,7 @@ class BuiltinTest(unittest.TestCase): def test_repr(self): self.assertEqual(repr(''), '\'\'') self.assertEqual(repr(0), '0') - self.assertEqual(repr(0L), '0') + self.assertEqual(repr(0), '0') self.assertEqual(repr(()), '()') self.assertEqual(repr([]), '[]') self.assertEqual(repr({}), '{}') @@ -1484,7 +1484,7 @@ class BuiltinTest(unittest.TestCase): def test_str(self): self.assertEqual(str(''), '') self.assertEqual(str(0), '0') - self.assertEqual(str(0L), '0') + self.assertEqual(str(0), '0') self.assertEqual(str(()), '()') self.assertEqual(str([]), '[]') self.assertEqual(str({}), '{}') diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index be95935..997122b 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -361,9 +361,9 @@ class BytesTest(unittest.TestCase): def test_contains(self): b = bytes("abc") self.failUnless(ord('a') in b) - self.failUnless(long(ord('a')) in b) + self.failUnless(int(ord('a')) in b) + self.failIf(200 in b) self.failIf(200 in b) - self.failIf(200L in b) self.assertRaises(ValueError, lambda: 300 in b) self.assertRaises(ValueError, lambda: -1 in b) self.assertRaises(TypeError, lambda: None in b) diff --git a/Lib/test/test_class.py b/Lib/test/test_class.py index 1758fd4..c450c80 100644 --- a/Lib/test/test_class.py +++ b/Lib/test/test_class.py @@ -84,10 +84,6 @@ class AllTests: print "__float__:", args return 1.0 - def __long__(self, *args): - print "__long__:", args - return 1L - def __oct__(self, *args): print "__oct__:", args return '01' @@ -238,7 +234,7 @@ else: +testme abs(testme) int(testme) -long(testme) +int(testme) float(testme) oct(testme) hex(testme) @@ -289,7 +285,6 @@ class BadTypeClass: def __int__(self): return None __float__ = __int__ - __long__ = __int__ __str__ = __int__ __repr__ = __int__ __oct__ = __int__ @@ -307,31 +302,11 @@ def check_exc(stmt, exception): check_exc("int(BadTypeClass())", TypeError) check_exc("float(BadTypeClass())", TypeError) -check_exc("long(BadTypeClass())", TypeError) check_exc("str(BadTypeClass())", TypeError) check_exc("repr(BadTypeClass())", TypeError) check_exc("oct(BadTypeClass())", TypeError) check_exc("hex(BadTypeClass())", TypeError) -# mixing up ints and longs is okay -class IntLongMixClass: - def __int__(self): - return 0L - - def __long__(self): - return 0 - -try: - int(IntLongMixClass()) -except TypeError: - raise TestFailed, "TypeError should not be raised" - -try: - long(IntLongMixClass()) -except TypeError: - raise TestFailed, "TypeError should not be raised" - - # Test correct errors from hash() on objects with comparisons but no __hash__ class C0: diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py index 7ee7dcd..6e0a181 100644 --- a/Lib/test/test_code.py +++ b/Lib/test/test_code.py @@ -70,7 +70,7 @@ consts: ('None',) ... 'doc string' ... 'not a docstring' ... 53 -... 53L +... 0x53 >>> dump(optimize_away.func_code) name: optimize_away diff --git a/Lib/test/test_compare.py b/Lib/test/test_compare.py index 8f38e3b..1d0da69 100644 --- a/Lib/test/test_compare.py +++ b/Lib/test/test_compare.py @@ -17,7 +17,7 @@ class Cmp: return self.arg == other class ComparisonTest(unittest.TestCase): - set1 = [2, 2.0, 2L, 2+0j, Cmp(2.0)] + set1 = [2, 2.0, 2, 2+0j, Cmp(2.0)] set2 = [[1], (3,), None, Empty()] candidates = set1 + set2 diff --git a/Lib/test/test_compile.py b/Lib/test/test_compile.py index b517daa..1acb4a1 100644 --- a/Lib/test/test_compile.py +++ b/Lib/test/test_compile.py @@ -182,10 +182,8 @@ if 1: self.assertRaises(SyntaxError, eval, arg) self.assertEqual(eval("0777"), 511) - self.assertEqual(eval("0777L"), 511) self.assertEqual(eval("000777"), 511) self.assertEqual(eval("0xff"), 255) - self.assertEqual(eval("0xffL"), 255) self.assertEqual(eval("0XfF"), 255) self.assertEqual(eval("0777."), 777) self.assertEqual(eval("0777.0"), 777) @@ -212,19 +210,19 @@ if 1: if sys.maxint == 2147483647: # 32-bit machine all_one_bits = '0xffffffff' - self.assertEqual(eval(all_one_bits), 4294967295L) - self.assertEqual(eval("-" + all_one_bits), -4294967295L) + self.assertEqual(eval(all_one_bits), 4294967295) + self.assertEqual(eval("-" + all_one_bits), -4294967295) elif sys.maxint == 9223372036854775807: # 64-bit machine all_one_bits = '0xffffffffffffffff' - self.assertEqual(eval(all_one_bits), 18446744073709551615L) - self.assertEqual(eval("-" + all_one_bits), -18446744073709551615L) + self.assertEqual(eval(all_one_bits), 18446744073709551615) + self.assertEqual(eval("-" + all_one_bits), -18446744073709551615) else: self.fail("How many bits *does* this machine have???") # Verify treatment of contant folding on -(sys.maxint+1) # i.e. -2147483648 on 32 bit platforms. Should return int, not long. self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 1)), int)) - self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 2)), long)) + self.assertTrue(isinstance(eval("%s" % (-sys.maxint - 2)), int)) if sys.maxint == 9223372036854775807: def test_32_63_bit_values(self): diff --git a/Lib/test/test_complex.py b/Lib/test/test_complex.py index 4aa799d..afc7cae 100644 --- a/Lib/test/test_complex.py +++ b/Lib/test/test_complex.py @@ -93,7 +93,7 @@ class ComplexTest(unittest.TestCase): self.assertRaises(ZeroDivisionError, complex.__floordiv__, 3+0j, 0+0j) def test_richcompare(self): - self.assertRaises(OverflowError, complex.__eq__, 1+1j, 1L<<10000) + self.assertRaises(OverflowError, complex.__eq__, 1+1j, 1<<10000) self.assertEqual(complex.__lt__(1+1j, None), NotImplemented) self.assertIs(complex.__eq__(1+1j, 1+1j), True) self.assertIs(complex.__eq__(1+1j, 2+2j), False) @@ -180,25 +180,25 @@ class ComplexTest(unittest.TestCase): self.assertAlmostEqual(complex("1+10j"), 1+10j) self.assertAlmostEqual(complex(10), 10+0j) self.assertAlmostEqual(complex(10.0), 10+0j) - self.assertAlmostEqual(complex(10L), 10+0j) + self.assertAlmostEqual(complex(10), 10+0j) self.assertAlmostEqual(complex(10+0j), 10+0j) self.assertAlmostEqual(complex(1,10), 1+10j) - self.assertAlmostEqual(complex(1,10L), 1+10j) + self.assertAlmostEqual(complex(1,10), 1+10j) + self.assertAlmostEqual(complex(1,10.0), 1+10j) + self.assertAlmostEqual(complex(1,10), 1+10j) + self.assertAlmostEqual(complex(1,10), 1+10j) self.assertAlmostEqual(complex(1,10.0), 1+10j) - self.assertAlmostEqual(complex(1L,10), 1+10j) - self.assertAlmostEqual(complex(1L,10L), 1+10j) - self.assertAlmostEqual(complex(1L,10.0), 1+10j) self.assertAlmostEqual(complex(1.0,10), 1+10j) - self.assertAlmostEqual(complex(1.0,10L), 1+10j) + self.assertAlmostEqual(complex(1.0,10), 1+10j) self.assertAlmostEqual(complex(1.0,10.0), 1+10j) self.assertAlmostEqual(complex(3.14+0j), 3.14+0j) self.assertAlmostEqual(complex(3.14), 3.14+0j) self.assertAlmostEqual(complex(314), 314.0+0j) - self.assertAlmostEqual(complex(314L), 314.0+0j) + self.assertAlmostEqual(complex(314), 314.0+0j) self.assertAlmostEqual(complex(3.14+0j, 0j), 3.14+0j) self.assertAlmostEqual(complex(3.14, 0.0), 3.14+0j) self.assertAlmostEqual(complex(314, 0), 314.0+0j) - self.assertAlmostEqual(complex(314L, 0L), 314.0+0j) + self.assertAlmostEqual(complex(314, 0), 314.0+0j) self.assertAlmostEqual(complex(0j, 3.14j), -3.14+0j) self.assertAlmostEqual(complex(0.0, 3.14j), -3.14+0j) self.assertAlmostEqual(complex(0j, 3.14), 3.14j) @@ -232,7 +232,7 @@ class ComplexTest(unittest.TestCase): self.assertRaises(ValueError, complex, '1+1j\0j') self.assertRaises(TypeError, int, 5+3j) - self.assertRaises(TypeError, long, 5+3j) + self.assertRaises(TypeError, int, 5+3j) self.assertRaises(TypeError, float, 5+3j) self.assertRaises(ValueError, complex, "") self.assertRaises(TypeError, complex, None) diff --git a/Lib/test/test_cookielib.py b/Lib/test/test_cookielib.py index 9b06869..cb9dffb 100644 --- a/Lib/test/test_cookielib.py +++ b/Lib/test/test_cookielib.py @@ -103,7 +103,7 @@ class HeaderTests(TestCase): from cookielib import parse_ns_headers # quotes should be stripped - expected = [[('foo', 'bar'), ('expires', 2209069412L), ('version', '0')]] + expected = [[('foo', 'bar'), ('expires', 2209069412), ('version', '0')]] for hdr in [ 'foo=bar; expires=01 Jan 2040 22:23:32 GMT', 'foo=bar; expires="01 Jan 2040 22:23:32 GMT"', diff --git a/Lib/test/test_copy.py b/Lib/test/test_copy.py index 416a755..8a32866 100644 --- a/Lib/test/test_copy.py +++ b/Lib/test/test_copy.py @@ -82,7 +82,7 @@ class TestCopy(unittest.TestCase): pass def f(): pass - tests = [None, 42, 2L**100, 3.14, True, False, 1j, + tests = [None, 42, 2**100, 3.14, True, False, 1j, "hello", u"hello\u1234", f.func_code, NewStyle, xrange(10), Classic, max] for x in tests: @@ -255,7 +255,7 @@ class TestCopy(unittest.TestCase): pass def f(): pass - tests = [None, 42, 2L**100, 3.14, True, False, 1j, + tests = [None, 42, 2**100, 3.14, True, False, 1j, "hello", u"hello\u1234", f.func_code, NewStyle, xrange(10), Classic, max] for x in tests: diff --git a/Lib/test/test_copy_reg.py b/Lib/test/test_copy_reg.py index c3d3964..34ca4ec 100644 --- a/Lib/test/test_copy_reg.py +++ b/Lib/test/test_copy_reg.py @@ -96,7 +96,7 @@ class CopyRegTestCase(unittest.TestCase): e.restore() # Ensure invalid codes blow up. - for code in -1, 0, 0x80000000L: + for code in -1, 0, 0x80000000: self.assertRaises(ValueError, copy_reg.add_extension, mod, func, code) diff --git a/Lib/test/test_datetime.py b/Lib/test/test_datetime.py index 3329104..b32017e 100644 --- a/Lib/test/test_datetime.py +++ b/Lib/test/test_datetime.py @@ -32,7 +32,7 @@ else: # An arbitrary collection of objects of non-datetime types, for testing # mixed-type comparisons. -OTHERSTUFF = (10, 10L, 34.5, "abc", {}, [], ()) +OTHERSTUFF = (10, 10, 34.5, "abc", {}, [], ()) ############################################################################# @@ -149,11 +149,11 @@ class HarmlessMixedComparison(unittest.TestCase): self.failIf(() == me) self.failUnless(() != me) - self.failUnless(me in [1, 20L, [], me]) - self.failIf(me not in [1, 20L, [], me]) + self.failUnless(me in [1, 20, [], me]) + self.failIf(me not in [1, 20, [], me]) - self.failUnless([] in [me, 1, 20L, []]) - self.failIf([] not in [me, 1, 20L, []]) + self.failUnless([] in [me, 1, 20, []]) + self.failIf([] not in [me, 1, 20, []]) def test_harmful_mixed_comparison(self): me = self.theclass(1, 1, 1) @@ -222,13 +222,13 @@ class TestTimeDelta(HarmlessMixedComparison): eq(td(0, 0, 60*1000000), b) eq(a*10, td(70)) eq(a*10, 10*a) - eq(a*10L, 10*a) + eq(a*10, 10*a) eq(b*10, td(0, 600)) eq(10*b, td(0, 600)) - eq(b*10L, td(0, 600)) + eq(b*10, td(0, 600)) eq(c*10, td(0, 0, 10000)) eq(10*c, td(0, 0, 10000)) - eq(c*10L, td(0, 0, 10000)) + eq(c*10, td(0, 0, 10000)) eq(a*-1, -a) eq(b*-2, -b-b) eq(c*-2, -c+-c) @@ -246,7 +246,7 @@ class TestTimeDelta(HarmlessMixedComparison): a = timedelta(42) # Add/sub ints, longs, floats should be illegal - for i in 1, 1L, 1.0: + for i in 1, 1, 1.0: self.assertRaises(TypeError, lambda: a+i) self.assertRaises(TypeError, lambda: a-i) self.assertRaises(TypeError, lambda: i+a) @@ -263,7 +263,7 @@ class TestTimeDelta(HarmlessMixedComparison): # Divison of int by timedelta doesn't make sense. # Division by zero doesn't make sense. - for zero in 0, 0L: + for zero in 0, 0: self.assertRaises(TypeError, lambda: zero // a) self.assertRaises(ZeroDivisionError, lambda: a // zero) @@ -696,7 +696,7 @@ class TestDate(HarmlessMixedComparison): self.assertEqual(a - (a - day), day) # Add/sub ints, longs, floats should be illegal - for i in 1, 1L, 1.0: + for i in 1, 1, 1.0: self.assertRaises(TypeError, lambda: a+i) self.assertRaises(TypeError, lambda: a-i) self.assertRaises(TypeError, lambda: i+a) @@ -1325,7 +1325,7 @@ class TestDateTime(TestDate): self.assertEqual(a - (week + day + hour + millisec), (((a - week) - day) - hour) - millisec) # Add/sub ints, longs, floats should be illegal - for i in 1, 1L, 1.0: + for i in 1, 1, 1.0: self.assertRaises(TypeError, lambda: a+i) self.assertRaises(TypeError, lambda: a-i) self.assertRaises(TypeError, lambda: i+a) diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index f9a9e82..4a53122 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -907,8 +907,8 @@ class DecimalUsabilityTest(unittest.TestCase): self.assertEqual(int(d2), 15) #long - self.assertEqual(long(d1), 66) - self.assertEqual(long(d2), 15) + self.assertEqual(int(d1), 66) + self.assertEqual(int(d2), 15) #float self.assertEqual(float(d1), 66) diff --git a/Lib/test/test_descr.py b/Lib/test/test_descr.py index bc95226..bcfadf7 100644 --- a/Lib/test/test_descr.py +++ b/Lib/test/test_descr.py @@ -191,7 +191,7 @@ def dict_constructor(): vereq(d, dict([("two", 2)], one=1)) vereq(d, dict([("one", 100), ("two", 200)], **d)) verify(d is not dict(**d)) - for badarg in 0, 0L, 0j, "0", [0], (0,): + for badarg in 0, 0, 0j, "0", [0], (0,): try: dict(badarg) except TypeError: @@ -264,7 +264,7 @@ def test_dir(): del junk # Just make sure these don't blow up! - for arg in 2, 2L, 2j, 2e0, [2], "2", u"2", (2,), {2:2}, type, test_dir: + for arg in 2, 2, 2j, 2e0, [2], "2", u"2", (2,), {2:2}, type, test_dir: dir(arg) # Test dir on custom classes. Since these have object as a @@ -385,7 +385,6 @@ unops = { 'abs': 'abs', 'invert': '~', 'int': 'int', - 'long': 'long', 'float': 'float', 'oct': 'oct', 'hex': 'hex', @@ -423,7 +422,7 @@ def ints(): class C(int): def __add__(self, other): return NotImplemented - vereq(C(5L), 5) + vereq(C(5), 5) try: C() + "" except TypeError: @@ -433,7 +432,7 @@ def ints(): def longs(): if verbose: print "Testing long operations..." - numops(100L, 3L) + numops(100, 3) def floats(): if verbose: print "Testing float operations..." @@ -1263,10 +1262,10 @@ def dynamics(): vereq(I(3)*I(2), 6) # Test handling of long*seq and seq*long - class L(long): + class L(int): pass - vereq("a"*L(2L), "aa") - vereq(L(2L)*"a", "aa") + vereq("a"*L(2), "aa") + vereq(L(2)*"a", "aa") vereq(2*L(3), 6) vereq(L(3)*2, 6) vereq(L(3)*L(2), 6) @@ -2041,7 +2040,7 @@ def inherits(): verify((hexint(0) << 12).__class__ is int) verify((hexint(0) >> 12).__class__ is int) - class octlong(long): + class octlong(int): __slots__ = [] def __str__(self): s = oct(self) @@ -2056,39 +2055,39 @@ def inherits(): # because the example uses a short int left argument.) vereq(str(5 + octlong(3000)), "05675") a = octlong(12345) - vereq(a, 12345L) - vereq(long(a), 12345L) - vereq(hash(a), hash(12345L)) - verify(long(a).__class__ is long) - verify((+a).__class__ is long) - verify((-a).__class__ is long) - verify((-octlong(0)).__class__ is long) - verify((a >> 0).__class__ is long) - verify((a << 0).__class__ is long) - verify((a - 0).__class__ is long) - verify((a * 1).__class__ is long) - verify((a ** 1).__class__ is long) - verify((a // 1).__class__ is long) - verify((1 * a).__class__ is long) - verify((a | 0).__class__ is long) - verify((a ^ 0).__class__ is long) - verify((a & -1L).__class__ is long) - verify((octlong(0) << 12).__class__ is long) - verify((octlong(0) >> 12).__class__ is long) - verify(abs(octlong(0)).__class__ is long) + vereq(a, 12345) + vereq(int(a), 12345) + vereq(hash(a), hash(12345)) + verify(int(a).__class__ is int) + verify((+a).__class__ is int) + verify((-a).__class__ is int) + verify((-octlong(0)).__class__ is int) + verify((a >> 0).__class__ is int) + verify((a << 0).__class__ is int) + verify((a - 0).__class__ is int) + verify((a * 1).__class__ is int) + verify((a ** 1).__class__ is int) + verify((a // 1).__class__ is int) + verify((1 * a).__class__ is int) + verify((a | 0).__class__ is int) + verify((a ^ 0).__class__ is int) + verify((a & -1).__class__ is int) + verify((octlong(0) << 12).__class__ is int) + verify((octlong(0) >> 12).__class__ is int) + verify(abs(octlong(0)).__class__ is int) # Because octlong overrides __add__, we can't check the absence of +0 # optimizations using octlong. - class longclone(long): + class longclone(int): pass a = longclone(1) - verify((a + 0).__class__ is long) - verify((0 + a).__class__ is long) + verify((a + 0).__class__ is int) + verify((0 + a).__class__ is int) # Check that negative clones don't segfault a = longclone(-1) vereq(a.__dict__, {}) - vereq(long(a), -1) # verify PyNumber_Long() copies the sign bit + vereq(int(a), -1) # verify PyNumber_Long() copies the sign bit class precfloat(float): __slots__ = ['prec'] @@ -2366,7 +2365,7 @@ def keywords(): print "Testing keyword args to basic type constructors ..." vereq(int(x=1), 1) vereq(float(x=2), 2.0) - vereq(long(x=3), 3L) + vereq(int(x=3), 3) vereq(complex(imag=42, real=666), complex(666, 42)) vereq(str(object=500), '500') vereq(unicode(string='abc', errors='strict'), u'abc') @@ -2374,7 +2373,7 @@ def keywords(): vereq(list(sequence=(0, 1, 2)), range(3)) # note: as of Python 2.3, dict() no longer has an "items" keyword arg - for constructor in (int, float, long, complex, str, unicode, + for constructor in (int, float, int, complex, str, unicode, tuple, list, file): try: constructor(bogus_keyword_arg=1) @@ -2472,37 +2471,37 @@ def classic_comparisons(): def __eq__(self, other): if isinstance(other, C): return self.value == other.value - if isinstance(other, int) or isinstance(other, long): + if isinstance(other, int) or isinstance(other, int): return self.value == other return NotImplemented def __ne__(self, other): if isinstance(other, C): return self.value != other.value - if isinstance(other, int) or isinstance(other, long): + if isinstance(other, int) or isinstance(other, int): return self.value != other return NotImplemented def __lt__(self, other): if isinstance(other, C): return self.value < other.value - if isinstance(other, int) or isinstance(other, long): + if isinstance(other, int) or isinstance(other, int): return self.value < other return NotImplemented def __le__(self, other): if isinstance(other, C): return self.value <= other.value - if isinstance(other, int) or isinstance(other, long): + if isinstance(other, int) or isinstance(other, int): return self.value <= other return NotImplemented def __gt__(self, other): if isinstance(other, C): return self.value > other.value - if isinstance(other, int) or isinstance(other, long): + if isinstance(other, int) or isinstance(other, int): return self.value > other return NotImplemented def __ge__(self, other): if isinstance(other, C): return self.value >= other.value - if isinstance(other, int) or isinstance(other, long): + if isinstance(other, int) or isinstance(other, int): return self.value >= other return NotImplemented @@ -2550,37 +2549,37 @@ def rich_comparisons(): def __eq__(self, other): if isinstance(other, C): return self.value == other.value - if isinstance(other, int) or isinstance(other, long): + if isinstance(other, int) or isinstance(other, int): return self.value == other return NotImplemented def __ne__(self, other): if isinstance(other, C): return self.value != other.value - if isinstance(other, int) or isinstance(other, long): + if isinstance(other, int) or isinstance(other, int): return self.value != other return NotImplemented def __lt__(self, other): if isinstance(other, C): return self.value < other.value - if isinstance(other, int) or isinstance(other, long): + if isinstance(other, int) or isinstance(other, int): return self.value < other return NotImplemented def __le__(self, other): if isinstance(other, C): return self.value <= other.value - if isinstance(other, int) or isinstance(other, long): + if isinstance(other, int) or isinstance(other, int): return self.value <= other return NotImplemented def __gt__(self, other): if isinstance(other, C): return self.value > other.value - if isinstance(other, int) or isinstance(other, long): + if isinstance(other, int) or isinstance(other, int): return self.value > other return NotImplemented def __ge__(self, other): if isinstance(other, C): return self.value >= other.value - if isinstance(other, int) or isinstance(other, long): + if isinstance(other, int) or isinstance(other, int): return self.value >= other return NotImplemented c1 = C(1) @@ -3250,11 +3249,11 @@ def imulbug(): y *= 2 vereq(y, (x, 2)) y = x - y *= 3L - vereq(y, (x, 3L)) + y *= 3 + vereq(y, (x, 3)) y = x - y *= 1L<<100 - vereq(y, (x, 1L<<100)) + y *= 1<<100 + vereq(y, (x, 1<<100)) y = x y *= None vereq(y, (x, None)) @@ -3444,7 +3443,7 @@ def do_this_first(): def __pow__(self, *args): pass try: - pow(0L, UserLong(), 0L) + pow(0, UserLong(), 0) except: pass @@ -3956,7 +3955,7 @@ def notimplemented(): else: raise TestFailed("no TypeError from %r" % (expr,)) - N1 = sys.maxint + 1L # might trigger OverflowErrors instead of TypeErrors + N1 = sys.maxint + 1 # might trigger OverflowErrors instead of TypeErrors N2 = sys.maxint # if sizeof(int) < sizeof(long), might trigger # ValueErrors instead of TypeErrors for metaclass in [type, types.ClassType]: diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py index c7fa15d..1042cb1 100644 --- a/Lib/test/test_dict.py +++ b/Lib/test/test_dict.py @@ -314,7 +314,7 @@ class DictTest(unittest.TestCase): # verify longs/ints get same value when key > 32 bits (for 64-bit archs) # see SF bug #689659 - x = 4503599627370496L + x = 4503599627370496 y = 4503599627370496 h = {x: 'anything', y: 'something else'} self.assertEqual(h[x], h[y]) @@ -371,7 +371,7 @@ class DictTest(unittest.TestCase): def test_eq(self): self.assertEqual({}, {}) - self.assertEqual({1: 2}, {1L: 2L}) + self.assertEqual({1: 2}, {1: 2}) class Exc(Exception): pass diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py index fc8a5a1..df78a32 100644 --- a/Lib/test/test_format.py +++ b/Lib/test/test_format.py @@ -57,14 +57,14 @@ testboth('%12.*f', (123456, 1.0)) # Formatting of long integers. Overflow is not ok overflowok = 0 -testboth("%x", 10L, "a") -testboth("%x", 100000000000L, "174876e800") -testboth("%o", 10L, "12") -testboth("%o", 100000000000L, "1351035564000") -testboth("%d", 10L, "10") -testboth("%d", 100000000000L, "100000000000") - -big = 123456789012345678901234567890L +testboth("%x", 10, "a") +testboth("%x", 100000000000, "174876e800") +testboth("%o", 10, "12") +testboth("%o", 100000000000, "1351035564000") +testboth("%d", 10, "10") +testboth("%d", 100000000000, "100000000000") + +big = 123456789012345678901234567890 testboth("%d", big, "123456789012345678901234567890") testboth("%d", -big, "-123456789012345678901234567890") testboth("%5d", -big, "-123456789012345678901234567890") @@ -83,7 +83,7 @@ testboth("%.30d", big, "123456789012345678901234567890") testboth("%.31d", big, "0123456789012345678901234567890") testboth("%32.31d", big, " 0123456789012345678901234567890") -big = 0x1234567890abcdef12345L # 21 hex digits +big = 0x1234567890abcdef12345 # 21 hex digits testboth("%x", big, "1234567890abcdef12345") testboth("%x", -big, "-1234567890abcdef12345") testboth("%5x", -big, "-1234567890abcdef12345") @@ -120,7 +120,7 @@ testboth("%#+027.23X", big, "+0X0001234567890ABCDEF12345") # same, except no 0 flag testboth("%#+27.23X", big, " +0X001234567890ABCDEF12345") -big = 012345670123456701234567012345670L # 32 octal digits +big = 012345670123456701234567012345670 # 32 octal digits testboth("%o", big, "12345670123456701234567012345670") testboth("%o", -big, "-12345670123456701234567012345670") testboth("%5o", -big, "-12345670123456701234567012345670") @@ -163,34 +163,34 @@ testboth("%0#34.33o", big, "0012345670123456701234567012345670") # Some small ints, in both Python int and long flavors). testboth("%d", 42, "42") testboth("%d", -42, "-42") -testboth("%d", 42L, "42") -testboth("%d", -42L, "-42") +testboth("%d", 42, "42") +testboth("%d", -42, "-42") testboth("%#x", 1, "0x1") -testboth("%#x", 1L, "0x1") +testboth("%#x", 1, "0x1") +testboth("%#X", 1, "0X1") testboth("%#X", 1, "0X1") -testboth("%#X", 1L, "0X1") testboth("%#o", 1, "01") -testboth("%#o", 1L, "01") +testboth("%#o", 1, "01") +testboth("%#o", 0, "0") testboth("%#o", 0, "0") -testboth("%#o", 0L, "0") testboth("%o", 0, "0") -testboth("%o", 0L, "0") +testboth("%o", 0, "0") testboth("%d", 0, "0") -testboth("%d", 0L, "0") +testboth("%d", 0, "0") +testboth("%#x", 0, "0x0") testboth("%#x", 0, "0x0") -testboth("%#x", 0L, "0x0") testboth("%#X", 0, "0X0") -testboth("%#X", 0L, "0X0") +testboth("%#X", 0, "0X0") testboth("%x", 0x42, "42") testboth("%x", -0x42, "-42") -testboth("%x", 0x42L, "42") -testboth("%x", -0x42L, "-42") +testboth("%x", 0x42, "42") +testboth("%x", -0x42, "-42") testboth("%o", 042, "42") testboth("%o", -042, "-42") -testboth("%o", 042L, "42") -testboth("%o", -042L, "-42") +testboth("%o", 042, "42") +testboth("%o", -042, "-42") # Test exception for unknown format characters if verbose: @@ -230,7 +230,7 @@ test_exc(u'no format', '1', TypeError, test_exc(u'no format', u'1', TypeError, "not all arguments converted during string formatting") -class Foobar(long): +class Foobar(int): def __oct__(self): # Returning a non-string should not blow up. return self + 1 diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index edc17fc..828331e 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -293,8 +293,8 @@ class TestReduce(unittest.TestCase): ) self.assertEqual(self.func(lambda x, y: x*y, range(2,8), 1), 5040) self.assertEqual( - self.func(lambda x, y: x*y, range(2,21), 1L), - 2432902008176640000L + self.func(lambda x, y: x*y, range(2,21), 1), + 2432902008176640000 ) self.assertEqual(self.func(lambda x, y: x+y, Squares(10)), 285) self.assertEqual(self.func(lambda x, y: x+y, Squares(10), 0), 285) diff --git a/Lib/test/test_generators.py b/Lib/test/test_generators.py index 30df034..a40d8ea 100644 --- a/Lib/test/test_generators.py +++ b/Lib/test/test_generators.py @@ -1057,9 +1057,9 @@ class Queens: # generates the possiblities for the columns in that row. self.rowgenerators = [] for i in rangen: - rowuses = [(1L << j) | # column ordinal - (1L << (n + i-j + n-1)) | # NW-SE ordinal - (1L << (n + 2*n-1 + i+j)) # NE-SW ordinal + rowuses = [(1 << j) | # column ordinal + (1 << (n + i-j + n-1)) | # NW-SE ordinal + (1 << (n + 2*n-1 + i+j)) # NE-SW ordinal for j in rangen] def rowgen(rowuses=rowuses): diff --git a/Lib/test/test_getargs2.py b/Lib/test/test_getargs2.py index c428f45..9172576 100644 --- a/Lib/test/test_getargs2.py +++ b/Lib/test/test_getargs2.py @@ -45,7 +45,7 @@ long long (if that exists). """ LARGE = 0x7FFFFFFF -VERY_LARGE = 0xFF0000121212121212121242L +VERY_LARGE = 0xFF0000121212121212121242 from _testcapi import UCHAR_MAX, USHRT_MAX, UINT_MAX, ULONG_MAX, INT_MAX, \ INT_MIN, LONG_MIN, LONG_MAX, PY_SSIZE_T_MIN, PY_SSIZE_T_MAX @@ -57,7 +57,7 @@ ULLONG_MAX = 2**64-1 class Long: def __int__(self): - return 99L + return 99 class Int: def __int__(self): @@ -77,7 +77,7 @@ class Unsigned_TestCase(unittest.TestCase): self.assertRaises(OverflowError, getargs_b, UCHAR_MAX + 1) self.failUnlessEqual(42, getargs_b(42)) - self.failUnlessEqual(42, getargs_b(42L)) + self.failUnlessEqual(42, getargs_b(42)) self.assertRaises(OverflowError, getargs_b, VERY_LARGE) def test_B(self): @@ -88,13 +88,13 @@ class Unsigned_TestCase(unittest.TestCase): self.failUnlessEqual(99, getargs_B(Int())) self.failUnlessEqual(UCHAR_MAX, getargs_B(-1)) - self.failUnlessEqual(UCHAR_MAX, getargs_B(-1L)) + self.failUnlessEqual(UCHAR_MAX, getargs_B(-1)) self.failUnlessEqual(0, getargs_B(0)) self.failUnlessEqual(UCHAR_MAX, getargs_B(UCHAR_MAX)) self.failUnlessEqual(0, getargs_B(UCHAR_MAX+1)) self.failUnlessEqual(42, getargs_B(42)) - self.failUnlessEqual(42, getargs_B(42L)) + self.failUnlessEqual(42, getargs_B(42)) self.failUnlessEqual(UCHAR_MAX & VERY_LARGE, getargs_B(VERY_LARGE)) def test_H(self): @@ -110,7 +110,7 @@ class Unsigned_TestCase(unittest.TestCase): self.failUnlessEqual(0, getargs_H(USHRT_MAX+1)) self.failUnlessEqual(42, getargs_H(42)) - self.failUnlessEqual(42, getargs_H(42L)) + self.failUnlessEqual(42, getargs_H(42)) self.failUnlessEqual(VERY_LARGE & USHRT_MAX, getargs_H(VERY_LARGE)) @@ -127,7 +127,7 @@ class Unsigned_TestCase(unittest.TestCase): self.failUnlessEqual(0, getargs_I(UINT_MAX+1)) self.failUnlessEqual(42, getargs_I(42)) - self.failUnlessEqual(42, getargs_I(42L)) + self.failUnlessEqual(42, getargs_I(42)) self.failUnlessEqual(VERY_LARGE & UINT_MAX, getargs_I(VERY_LARGE)) @@ -145,7 +145,7 @@ class Unsigned_TestCase(unittest.TestCase): self.failUnlessEqual(0, getargs_k(ULONG_MAX+1)) self.failUnlessEqual(42, getargs_k(42)) - self.failUnlessEqual(42, getargs_k(42L)) + self.failUnlessEqual(42, getargs_k(42)) self.failUnlessEqual(VERY_LARGE & ULONG_MAX, getargs_k(VERY_LARGE)) @@ -163,7 +163,7 @@ class Signed_TestCase(unittest.TestCase): self.assertRaises(OverflowError, getargs_i, INT_MAX+1) self.failUnlessEqual(42, getargs_i(42)) - self.failUnlessEqual(42, getargs_i(42L)) + self.failUnlessEqual(42, getargs_i(42)) self.assertRaises(OverflowError, getargs_i, VERY_LARGE) def test_l(self): @@ -179,7 +179,7 @@ class Signed_TestCase(unittest.TestCase): self.assertRaises(OverflowError, getargs_l, LONG_MAX+1) self.failUnlessEqual(42, getargs_l(42)) - self.failUnlessEqual(42, getargs_l(42L)) + self.failUnlessEqual(42, getargs_l(42)) self.assertRaises(OverflowError, getargs_l, VERY_LARGE) def test_n(self): @@ -196,7 +196,7 @@ class Signed_TestCase(unittest.TestCase): self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MAX+1) self.failUnlessEqual(42, getargs_n(42)) - self.failUnlessEqual(42, getargs_n(42L)) + self.failUnlessEqual(42, getargs_n(42)) self.assertRaises(OverflowError, getargs_n, VERY_LARGE) @@ -215,7 +215,7 @@ class LongLong_TestCase(unittest.TestCase): self.assertRaises(OverflowError, getargs_L, LLONG_MAX+1) self.failUnlessEqual(42, getargs_L(42)) - self.failUnlessEqual(42, getargs_L(42L)) + self.failUnlessEqual(42, getargs_L(42)) self.assertRaises(OverflowError, getargs_L, VERY_LARGE) def test_K(self): @@ -229,7 +229,7 @@ class LongLong_TestCase(unittest.TestCase): self.failUnlessEqual(0, getargs_K(ULLONG_MAX+1)) self.failUnlessEqual(42, getargs_K(42)) - self.failUnlessEqual(42, getargs_K(42L)) + self.failUnlessEqual(42, getargs_K(42)) self.failUnlessEqual(VERY_LARGE & ULLONG_MAX, getargs_K(VERY_LARGE)) diff --git a/Lib/test/test_grammar.py b/Lib/test/test_grammar.py index 0d36a62..33bfd32 100644 --- a/Lib/test/test_grammar.py +++ b/Lib/test/test_grammar.py @@ -55,14 +55,14 @@ class TokenTests(unittest.TestCase): self.fail('Weird maxint value %r' % maxint) def testLongIntegers(self): - x = 0L - x = 0l - x = 0xffffffffffffffffL - x = 0xffffffffffffffffl - x = 077777777777777777L - x = 077777777777777777l - x = 123456789012345678901234567890L - x = 123456789012345678901234567890l + x = 0 + x = 0 + x = 0xffffffffffffffff + x = 0xffffffffffffffff + x = 077777777777777777 + x = 077777777777777777 + x = 123456789012345678901234567890 + x = 123456789012345678901234567890 def testFloats(self): x = 3.14 @@ -327,7 +327,7 @@ class GrammarTests(unittest.TestCase): l1 = lambda : 0 self.assertEquals(l1(), 0) l2 = lambda : a[d] # XXX just testing the expression - l3 = lambda : [2 < x for x in [-1, 3, 0L]] + l3 = lambda : [2 < x for x in [-1, 3, 0]] self.assertEquals(l3(), [0, 1, 0]) l4 = lambda x = lambda y = lambda z=1 : z : y() : x() self.assertEquals(l4(), 1) diff --git a/Lib/test/test_hash.py b/Lib/test/test_hash.py index 3d6c9d1..9578537 100644 --- a/Lib/test/test_hash.py +++ b/Lib/test/test_hash.py @@ -17,14 +17,14 @@ class HashEqualityTestCase(unittest.TestCase): self.fail("hashed values differ: %r" % (objlist,)) def test_numeric_literals(self): - self.same_hash(1, 1L, 1.0, 1.0+0.0j) + self.same_hash(1, 1, 1.0, 1.0+0.0j) def test_coerced_integers(self): - self.same_hash(int(1), long(1), float(1), complex(1), + self.same_hash(int(1), int(1), float(1), complex(1), int('1'), float('1.0')) def test_coerced_floats(self): - self.same_hash(long(1.23e300), float(1.23e300)) + self.same_hash(int(1.23e300), float(1.23e300)) self.same_hash(float(0.5), complex(0.5, 0.0)) diff --git a/Lib/test/test_hexoct.py b/Lib/test/test_hexoct.py index f71dbe0..5e86bea 100644 --- a/Lib/test/test_hexoct.py +++ b/Lib/test/test_hexoct.py @@ -41,26 +41,26 @@ class TextHexOct(unittest.TestCase): def test_hex_unsigned(self): if platform_long_is_32_bits: # Positive constants - self.assertEqual(0x80000000, 2147483648L) - self.assertEqual(0xffffffff, 4294967295L) + self.assertEqual(0x80000000, 2147483648) + self.assertEqual(0xffffffff, 4294967295) # Ditto with a minus sign and parentheses - self.assertEqual(-(0x80000000), -2147483648L) - self.assertEqual(-(0xffffffff), -4294967295L) + self.assertEqual(-(0x80000000), -2147483648) + self.assertEqual(-(0xffffffff), -4294967295) # Ditto with a minus sign and NO parentheses # This failed in Python 2.2 through 2.2.2 and in 2.3a1 - self.assertEqual(-0x80000000, -2147483648L) - self.assertEqual(-0xffffffff, -4294967295L) + self.assertEqual(-0x80000000, -2147483648) + self.assertEqual(-0xffffffff, -4294967295) else: # Positive constants - self.assertEqual(0x8000000000000000, 9223372036854775808L) - self.assertEqual(0xffffffffffffffff, 18446744073709551615L) + self.assertEqual(0x8000000000000000, 9223372036854775808) + self.assertEqual(0xffffffffffffffff, 18446744073709551615) # Ditto with a minus sign and parentheses - self.assertEqual(-(0x8000000000000000), -9223372036854775808L) - self.assertEqual(-(0xffffffffffffffff), -18446744073709551615L) + self.assertEqual(-(0x8000000000000000), -9223372036854775808) + self.assertEqual(-(0xffffffffffffffff), -18446744073709551615) # Ditto with a minus sign and NO parentheses # This failed in Python 2.2 through 2.2.2 and in 2.3a1 - self.assertEqual(-0x8000000000000000, -9223372036854775808L) - self.assertEqual(-0xffffffffffffffff, -18446744073709551615L) + self.assertEqual(-0x8000000000000000, -9223372036854775808) + self.assertEqual(-0xffffffffffffffff, -18446744073709551615) def test_oct_baseline(self): # Baseline tests @@ -88,26 +88,26 @@ class TextHexOct(unittest.TestCase): def test_oct_unsigned(self): if platform_long_is_32_bits: # Positive constants - self.assertEqual(020000000000, 2147483648L) - self.assertEqual(037777777777, 4294967295L) + self.assertEqual(020000000000, 2147483648) + self.assertEqual(037777777777, 4294967295) # Ditto with a minus sign and parentheses - self.assertEqual(-(020000000000), -2147483648L) - self.assertEqual(-(037777777777), -4294967295L) + self.assertEqual(-(020000000000), -2147483648) + self.assertEqual(-(037777777777), -4294967295) # Ditto with a minus sign and NO parentheses # This failed in Python 2.2 through 2.2.2 and in 2.3a1 - self.assertEqual(-020000000000, -2147483648L) - self.assertEqual(-037777777777, -4294967295L) + self.assertEqual(-020000000000, -2147483648) + self.assertEqual(-037777777777, -4294967295) else: # Positive constants - self.assertEqual(01000000000000000000000, 9223372036854775808L) - self.assertEqual(01777777777777777777777, 18446744073709551615L) + self.assertEqual(01000000000000000000000, 9223372036854775808) + self.assertEqual(01777777777777777777777, 18446744073709551615) # Ditto with a minus sign and parentheses - self.assertEqual(-(01000000000000000000000), -9223372036854775808L) - self.assertEqual(-(01777777777777777777777), -18446744073709551615L) + self.assertEqual(-(01000000000000000000000), -9223372036854775808) + self.assertEqual(-(01777777777777777777777), -18446744073709551615) # Ditto with a minus sign and NO parentheses # This failed in Python 2.2 through 2.2.2 and in 2.3a1 - self.assertEqual(-01000000000000000000000, -9223372036854775808L) - self.assertEqual(-01777777777777777777777, -18446744073709551615L) + self.assertEqual(-01000000000000000000000, -9223372036854775808) + self.assertEqual(-01777777777777777777777, -18446744073709551615) def test_main(): test_support.run_unittest(TextHexOct) diff --git a/Lib/test/test_index.py b/Lib/test/test_index.py index ecb566d..0045469 100644 --- a/Lib/test/test_index.py +++ b/Lib/test/test_index.py @@ -15,7 +15,7 @@ class TrapInt(int): def __index__(self): return self -class TrapLong(long): +class TrapLong(int): def __index__(self): return self @@ -44,7 +44,7 @@ class BaseTestCase(unittest.TestCase): self.o.ind = 4 self.n.ind = 5 self.assertEqual(6 .__index__(), 6) - self.assertEqual(-7L.__index__(), -7) + self.assertEqual(-7 .__index__(), -7) self.assertEqual(self.o.__index__(), 4) self.assertEqual(self.n.__index__(), 5) diff --git a/Lib/test/test_isinstance.py b/Lib/test/test_isinstance.py index 25b0816..cc2b5fd 100644 --- a/Lib/test/test_isinstance.py +++ b/Lib/test/test_isinstance.py @@ -242,7 +242,7 @@ class TestIsInstanceIsSubclass(unittest.TestCase): self.assertEqual(False, issubclass(NewChild, ())) self.assertEqual(True, issubclass(NewSuper, (NewChild, (NewSuper,)))) - self.assertEqual(True, issubclass(int, (long, (float, int)))) + self.assertEqual(True, issubclass(int, (int, (float, int)))) if test_support.have_unicode: self.assertEqual(True, issubclass(str, (unicode, (Child, NewChild, basestring)))) diff --git a/Lib/test/test_largefile.py b/Lib/test/test_largefile.py index 4dca97f..d7ed1b3 100644 --- a/Lib/test/test_largefile.py +++ b/Lib/test/test_largefile.py @@ -19,7 +19,7 @@ except (ImportError, AttributeError): # create >2GB file (2GB = 2147483648 bytes) -size = 2500000000L +size = 2500000000 name = test_support.TESTFN @@ -37,7 +37,7 @@ else: f = open(test_support.TESTFN, 'wb') try: # 2**31 == 2147483648 - f.seek(2147483649L) + f.seek(2147483649) # Seeking is not enough of a test: you must write and flush, too! f.write("x") f.flush() diff --git a/Lib/test/test_long.py b/Lib/test/test_long.py index e0c781f..2876f83 100644 --- a/Lib/test/test_long.py +++ b/Lib/test/test_long.py @@ -23,11 +23,11 @@ KARATSUBA_CUTOFF = 70 # from longobject.c MAXDIGITS = 15 # build some special values -special = map(long, [0, 1, 2, BASE, BASE >> 1]) -special.append(0x5555555555555555L) -special.append(0xaaaaaaaaaaaaaaaaL) +special = map(int, [0, 1, 2, BASE, BASE >> 1]) +special.append(0x5555555555555555) +special.append(0xaaaaaaaaaaaaaaaa) # some solid strings of one bits -p2 = 4L # 0 and 1 already added +p2 = 4 # 0 and 1 already added for i in range(2*SHIFT): special.append(p2 - 1) p2 = p2 << 1 @@ -49,7 +49,7 @@ class LongTest(unittest.TestCase): self.assert_(ndigits > 0) nbits_hi = ndigits * SHIFT nbits_lo = nbits_hi - SHIFT + 1 - answer = 0L + answer = 0 nbits = 0 r = int(random.random() * (SHIFT * 2)) | 1 # force 1 bits to start while nbits < nbits_lo: @@ -70,7 +70,7 @@ class LongTest(unittest.TestCase): # BASE). The sign bit is also random. def getran2(ndigits): - answer = 0L + answer = 0 for i in xrange(ndigits): answer = (answer << SHIFT) | random.randint(0, MASK) if random.random() < 0.5: @@ -98,7 +98,7 @@ class LongTest(unittest.TestCase): for lenx in digits: x = self.getran(lenx) for leny in digits: - y = self.getran(leny) or 1L + y = self.getran(leny) or 1 self.check_division(x, y) def test_karatsuba(self): @@ -110,15 +110,15 @@ class LongTest(unittest.TestCase): # Test products of long strings of 1 bits -- (2**x-1)*(2**y-1) == # 2**(x+y) - 2**x - 2**y + 1, so the proper result is easy to check. for abits in bits: - a = (1L << abits) - 1 + a = (1 << abits) - 1 for bbits in bits: if bbits < abits: continue - b = (1L << bbits) - 1 + b = (1 << bbits) - 1 x = a * b - y = ((1L << (abits + bbits)) - - (1L << abits) - - (1L << bbits) + + y = ((1 << (abits + bbits)) - + (1 << abits) - + (1 << bbits) + 1) self.assertEqual(x, y, Frm("bad result for a*b: a=%r, b=%r, x=%r, y=%r", a, b, x, y)) @@ -141,7 +141,7 @@ class LongTest(unittest.TestCase): eq(-x, 1 + ~x, Frm("not -x == 1 + ~x for x=%r", x)) eq(-x, ~(x-1), Frm("not -x == ~(x-1) forx =%r", x)) for n in xrange(2*SHIFT): - p2 = 2L ** n + p2 = 2 ** n eq(x << n >> n, x, Frm("x << n >> n != x for x=%r, n=%r", (x, n))) eq(x // p2, x >> n, @@ -217,7 +217,7 @@ class LongTest(unittest.TestCase): msg = Frm("%s returned %r but expected %r for %r", mapper.__name__, got, expected, x) self.assertEqual(got, expected, msg) - self.assertEqual(long(got, 0), x, Frm('long("%s", 0) != %r', got, x)) + self.assertEqual(int(got, 0), x, Frm('long("%s", 0) != %r', got, x)) # str() has to be checked a little differently since there's no # trailing "L" got = str(x) @@ -240,8 +240,8 @@ class LongTest(unittest.TestCase): # check the extremes in int<->long conversion hugepos = sys.maxint hugeneg = -hugepos - 1 - hugepos_aslong = long(hugepos) - hugeneg_aslong = long(hugeneg) + hugepos_aslong = int(hugepos) + hugeneg_aslong = int(hugeneg) self.assertEqual(hugepos, hugepos_aslong, "long(sys.maxint) != sys.maxint") self.assertEqual(hugeneg, hugeneg_aslong, "long(-sys.maxint-1) != -sys.maxint-1") @@ -270,7 +270,7 @@ class LongTest(unittest.TestCase): y = int(x) except OverflowError: self.fail("int(long(sys.maxint) + 1) mustn't overflow") - self.assert_(isinstance(y, long), + self.assert_(isinstance(y, int), "int(long(sys.maxint) + 1) should have returned long") x = hugeneg_aslong - 1 @@ -278,14 +278,14 @@ class LongTest(unittest.TestCase): y = int(x) except OverflowError: self.fail("int(long(-sys.maxint-1) - 1) mustn't overflow") - self.assert_(isinstance(y, long), + self.assert_(isinstance(y, int), "int(long(-sys.maxint-1) - 1) should have returned long") - class long2(long): + class long2(int): pass - x = long2(1L<<100) + x = long2(1<<100) y = int(x) - self.assert_(type(y) is long, + self.assert_(type(y) is int, "overflowing int conversion must return long not long subtype") # long -> Py_ssize_t conversion @@ -293,10 +293,10 @@ class LongTest(unittest.TestCase): def __getslice__(self, i, j): return i, j - self.assertEqual(X()[-5L:7L], (-5, 7)) + self.assertEqual(X()[-5:7], (-5, 7)) # use the clamping effect to test the smallest and largest longs # that fit a Py_ssize_t - slicemin, slicemax = X()[-2L**100:2L**100] + slicemin, slicemax = X()[-2**100:2**100] self.assertEqual(X()[slicemin:slicemax], (slicemin, slicemax)) # ----------------------------------- tests of auto int->long conversion @@ -315,14 +315,14 @@ class LongTest(unittest.TestCase): Frm("for %r expected %r got %r", args, expected, got)) for x in special: - longx = long(x) + longx = int(x) expected = -longx got = -x checkit('-', x) for y in special: - longy = long(y) + longy = int(y) expected = longx + longy got = x + y @@ -357,20 +357,20 @@ class LongTest(unittest.TestCase): for z in special: if z != 0 : if y >= 0: - expected = pow(longx, longy, long(z)) + expected = pow(longx, longy, int(z)) got = pow(x, y, z) checkit('pow', x, y, '%', z) else: - self.assertRaises(TypeError, pow,longx, longy, long(z)) + self.assertRaises(TypeError, pow,longx, longy, int(z)) def test_float_overflow(self): import math for x in -2.0, -1.0, 0.0, 1.0, 2.0: - self.assertEqual(float(long(x)), x) + self.assertEqual(float(int(x)), x) shuge = '12345' * 120 - huge = 1L << 30000 + huge = 1 << 30000 mhuge = -huge namespace = {'huge': huge, 'mhuge': mhuge, 'shuge': shuge, 'math': math} for test in ["float(huge)", "float(mhuge)", @@ -410,7 +410,7 @@ class LongTest(unittest.TestCase): log = math.log(value) self.assertAlmostEqual(log, expected) - for bad in -(1L << 10000), -2L, 0L: + for bad in -(1 << 10000), -2, 0: self.assertRaises(ValueError, math.log, bad) self.assertRaises(ValueError, math.log10, bad) @@ -426,7 +426,7 @@ class LongTest(unittest.TestCase): # represents all Python ints, longs and floats exactly). class Rat: def __init__(self, value): - if isinstance(value, (int, long)): + if isinstance(value, (int, int)): self.n = value self.d = 1 elif isinstance(value, float): @@ -475,12 +475,12 @@ class LongTest(unittest.TestCase): # important boundary for IEEE double precision. for t in 2.0**48, 2.0**50, 2.0**53: cases.extend([t - 1.0, t - 0.3, t, t + 0.3, t + 1.0, - long(t-1), long(t), long(t+1)]) + int(t-1), int(t), int(t+1)]) cases.extend([0, 1, 2, sys.maxint, float(sys.maxint)]) # 1L<<20000 should exceed all double formats. long(1e200) is to # check that we get equality with 1e200 above. - t = long(1e200) - cases.extend([0L, 1L, 2L, 1L << 20000, t-1, t, t+1]) + t = int(1e200) + cases.extend([0, 1, 2, 1 << 20000, t-1, t, t+1]) cases.extend([-x for x in cases]) for x in cases: Rx = Rat(x) diff --git a/Lib/test/test_long_future.py b/Lib/test/test_long_future.py index 074c148..3f137d6 100644 --- a/Lib/test/test_long_future.py +++ b/Lib/test/test_long_future.py @@ -8,16 +8,16 @@ from test.test_support import TestFailed, verify, verbose def test_true_division(): if verbose: print "long true division" - huge = 1L << 40000 + huge = 1 << 40000 mhuge = -huge verify(huge / huge == 1.0) verify(mhuge / mhuge == 1.0) verify(huge / mhuge == -1.0) verify(mhuge / huge == -1.0) verify(1 / huge == 0.0) - verify(1L / huge == 0.0) + verify(1 / huge == 0.0) + verify(1 / mhuge == 0.0) verify(1 / mhuge == 0.0) - verify(1L / mhuge == 0.0) verify((666 * huge + (huge >> 1)) / huge == 666.5) verify((666 * mhuge + (mhuge >> 1)) / mhuge == 666.5) verify((666 * huge + (huge >> 1)) / mhuge == -666.5) @@ -28,8 +28,8 @@ def test_true_division(): namespace = {'huge': huge, 'mhuge': mhuge} for overflow in ["float(huge)", "float(mhuge)", - "huge / 1", "huge / 2L", "huge / -1", "huge / -2L", - "mhuge / 100", "mhuge / 100L"]: + "huge / 1", "huge / 2", "huge / -1", "huge / -2", + "mhuge / 100", "mhuge / 100"]: try: eval(overflow, namespace) except OverflowError: @@ -37,14 +37,14 @@ def test_true_division(): else: raise TestFailed("expected OverflowError from %r" % overflow) - for underflow in ["1 / huge", "2L / huge", "-1 / huge", "-2L / huge", - "100 / mhuge", "100L / mhuge"]: + for underflow in ["1 / huge", "2 / huge", "-1 / huge", "-2 / huge", + "100 / mhuge", "100 / mhuge"]: result = eval(underflow, namespace) if result != 0.0: raise TestFailed("expected underflow to 0 from %r" % underflow) - for zero in ["huge / 0", "huge / 0L", - "mhuge / 0", "mhuge / 0L"]: + for zero in ["huge / 0", "huge / 0", + "mhuge / 0", "mhuge / 0"]: try: eval(zero, namespace) except ZeroDivisionError: diff --git a/Lib/test/test_marshal.py b/Lib/test/test_marshal.py index fa1f688..bcd2918 100644 --- a/Lib/test/test_marshal.py +++ b/Lib/test/test_marshal.py @@ -33,7 +33,7 @@ class IntTestCase(unittest.TestCase): value >>= 8 return ''.join(bytes) - maxint64 = (1L << 63) - 1 + maxint64 = (1 << 63) - 1 minint64 = -maxint64-1 for base in maxint64, minint64, -maxint64, -(minint64 >> 1): @@ -152,7 +152,7 @@ class ContainerTestCase(unittest.TestCase): d = {'astring': 'foo@bar.baz.spam', 'afloat': 7283.43, 'anint': 2**20, - 'ashortlong': 2L, + 'ashortlong': 2, 'alist': ['.zyx.41'], 'atuple': ('.zyx.41',)*10, 'aboolean': False, @@ -204,7 +204,7 @@ class BugsTestCase(unittest.TestCase): def test_patch_873224(self): self.assertRaises(Exception, marshal.loads, '0') self.assertRaises(Exception, marshal.loads, 'f') - self.assertRaises(Exception, marshal.loads, marshal.dumps(2**65L)[:-1]) + self.assertRaises(Exception, marshal.loads, marshal.dumps(2**65)[:-1]) def test_version_argument(self): # Python 2.4.0 crashes for any call to marshal.dumps(x, y) diff --git a/Lib/test/test_multibytecodec_support.py b/Lib/test/test_multibytecodec_support.py index 50ed481..d94d115 100644 --- a/Lib/test/test_multibytecodec_support.py +++ b/Lib/test/test_multibytecodec_support.py @@ -98,7 +98,7 @@ class TestBase: def test_callback_long_index(self): def myreplace(exc): - return (u'x', long(exc.end)) + return (u'x', int(exc.end)) codecs.register_error("test.cjktest", myreplace) self.assertEqual(self.encode(u'abcd' + self.unmappedunicode + u'efgh', 'test.cjktest'), ('abcdxefgh', 9)) diff --git a/Lib/test/test_operator.py b/Lib/test/test_operator.py index 152d5ec..c71a4e6 100644 --- a/Lib/test/test_operator.py +++ b/Lib/test/test_operator.py @@ -199,7 +199,7 @@ class OperatorTestCase(unittest.TestCase): self.failUnlessRaises(TypeError, operator.isNumberType) self.failUnless(operator.isNumberType(8)) self.failUnless(operator.isNumberType(8j)) - self.failUnless(operator.isNumberType(8L)) + self.failUnless(operator.isNumberType(8)) self.failUnless(operator.isNumberType(8.3)) self.failIf(operator.isNumberType(dir())) diff --git a/Lib/test/test_optparse.py b/Lib/test/test_optparse.py index e05fbc6..6ec2902 100644 --- a/Lib/test/test_optparse.py +++ b/Lib/test/test_optparse.py @@ -1598,7 +1598,7 @@ class TestParseNumber(BaseTest): def setUp(self): self.parser = InterceptingOptionParser() self.parser.add_option("-n", type=int) - self.parser.add_option("-l", type=long) + self.parser.add_option("-l", type=int) def test_parse_num_fail(self): self.assertRaises( @@ -1606,17 +1606,17 @@ class TestParseNumber(BaseTest): ValueError, re.compile(r"invalid literal for int().*: '?'?")) self.assertRaises( - _parse_num, ("0xOoops", long), {}, + _parse_num, ("0xOoops", int), {}, ValueError, re.compile(r"invalid literal for int().*: '?0xOoops'?")) def test_parse_num_ok(self): self.assertEqual(_parse_num("0", int), 0) self.assertEqual(_parse_num("0x10", int), 16) - self.assertEqual(_parse_num("0XA", long), 10L) - self.assertEqual(_parse_num("010", long), 8L) + self.assertEqual(_parse_num("0XA", int), 10) + self.assertEqual(_parse_num("010", int), 8) self.assertEqual(_parse_num("0b11", int), 3) - self.assertEqual(_parse_num("0b", long), 0L) + self.assertEqual(_parse_num("0b", int), 0) def test_numeric_options(self): self.assertParseOK(["-n", "42", "-l", "0x20"], diff --git a/Lib/test/test_poll.py b/Lib/test/test_poll.py index 60cd3f4..6fbe1b6 100644 --- a/Lib/test/test_poll.py +++ b/Lib/test/test_poll.py @@ -143,7 +143,7 @@ class PollTests(unittest.TestCase): pollster = select.poll() pollster.register(1) - self.assertRaises(OverflowError, pollster.poll, 1L << 64) + self.assertRaises(OverflowError, pollster.poll, 1 << 64) x = 2 + 3 if x != 5: diff --git a/Lib/test/test_pow.py b/Lib/test/test_pow.py index c6ab218..493aac2 100644 --- a/Lib/test/test_pow.py +++ b/Lib/test/test_pow.py @@ -18,14 +18,14 @@ class PowTest(unittest.TestCase): self.assertEquals(pow(2, i), pow2) if i != 30 : pow2 = pow2*2 - for othertype in int, long: + for othertype in int, int: for i in range(-10, 0) + range(1, 10): ii = type(i) for j in range(1, 11): jj = -othertype(j) pow(ii, jj) - for othertype in int, long, float: + for othertype in int, int, float: for i in range(1, 100): zero = type(0) exp = -othertype(i/10.0) @@ -42,7 +42,7 @@ class PowTest(unittest.TestCase): asseq = self.assertAlmostEqual elif type == int: jl = 0 - elif type == long: + elif type == int: jl, jh = 0, 15 for i in range(il, ih+1): for j in range(jl, jh+1): @@ -60,7 +60,7 @@ class PowTest(unittest.TestCase): self.powtest(int) def test_powlong(self): - self.powtest(long) + self.powtest(int) def test_powfloat(self): self.powtest(float) @@ -74,12 +74,12 @@ class PowTest(unittest.TestCase): self.assertEquals(pow(-3,3) % -8, pow(-3,3,-8)) self.assertEquals(pow(5,2) % -8, pow(5,2,-8)) - self.assertEquals(pow(3L,3L) % 8, pow(3L,3L,8)) - self.assertEquals(pow(3L,3L) % -8, pow(3L,3L,-8)) - self.assertEquals(pow(3L,2) % -2, pow(3L,2,-2)) - self.assertEquals(pow(-3L,3L) % 8, pow(-3L,3L,8)) - self.assertEquals(pow(-3L,3L) % -8, pow(-3L,3L,-8)) - self.assertEquals(pow(5L,2) % -8, pow(5L,2,-8)) + self.assertEquals(pow(3,3) % 8, pow(3,3,8)) + self.assertEquals(pow(3,3) % -8, pow(3,3,-8)) + self.assertEquals(pow(3,2) % -2, pow(3,2,-2)) + self.assertEquals(pow(-3,3) % 8, pow(-3,3,8)) + self.assertEquals(pow(-3,3) % -8, pow(-3,3,-8)) + self.assertEquals(pow(5,2) % -8, pow(5,2,-8)) for i in range(-10, 11): for j in range(0, 6): @@ -91,8 +91,8 @@ class PowTest(unittest.TestCase): ) if j >= 0 and k != 0: self.assertEquals( - pow(long(i),j) % k, - pow(long(i),j,k) + pow(int(i),j) % k, + pow(int(i),j,k) ) def test_bug643260(self): diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py index 09ba268..8fc8d10 100644 --- a/Lib/test/test_pprint.py +++ b/Lib/test/test_pprint.py @@ -114,12 +114,12 @@ class QueryTestCase(unittest.TestCase): # multiple lines. For that reason, dicts with more than one element # aren't tested here. verify = self.assert_ - for simple in (0, 0L, 0+0j, 0.0, "", uni(""), + for simple in (0, 0, 0+0j, 0.0, "", uni(""), (), tuple2(), tuple3(), [], list2(), list3(), {}, dict2(), dict3(), verify, pprint, - -6, -6L, -6-6j, -1.5, "x", uni("x"), (3,), [3], {3: 6}, + -6, -6, -6-6j, -1.5, "x", uni("x"), (3,), [3], {3: 6}, (1,2), [3,4], {5: 6, 7: 8}, tuple2((1,2)), tuple3((1,2)), tuple3(range(100)), [3,4], list2([3,4]), list3([3,4]), list3(range(100)), diff --git a/Lib/test/test_random.py b/Lib/test/test_random.py index 7ec130d..0e0a273 100644 --- a/Lib/test/test_random.py +++ b/Lib/test/test_random.py @@ -34,7 +34,7 @@ class TestBasicOps(unittest.TestCase): self.assertEqual(randseq, self.randomlist(N)) def test_seedargs(self): - for arg in [None, 0, 0L, 1, 1L, -1, -1L, 10**20, -(10**20), + for arg in [None, 0, 0, 1, 1, -1, -1, 10**20, -(10**20), 3.14, 1+2j, 'a', tuple('abc')]: self.gen.seed(arg) for arg in [range(3), dict(one=1)]: @@ -268,7 +268,7 @@ class SystemRandom_TestBasicOps(TestBasicOps): # show that: k = int(1.001 + _log(n, 2)) # is equal to or one greater than the number of bits in n for i in xrange(1, 1000): - n = 1L << i # check an exact power of two + n = 1 << i # check an exact power of two numbits = i+1 k = int(1.00001 + _log(n, 2)) self.assertEqual(k, numbits) @@ -327,7 +327,7 @@ class MersenneTwister_TestBasicOps(TestBasicOps): 0.089215024911993401, 0.78486196105372907] - self.gen.seed(61731L + (24903L<<32) + (614L<<64) + (42143L<<96)) + self.gen.seed(61731 + (24903<<32) + (614<<64) + (42143<<96)) actual = self.randomlist(2000)[-10:] for a, e in zip(actual, expected): self.assertAlmostEqual(a,e,places=14) @@ -339,20 +339,20 @@ class MersenneTwister_TestBasicOps(TestBasicOps): # no rounding errors -- all results are exact). from math import ldexp - expected = [0x0eab3258d2231fL, - 0x1b89db315277a5L, - 0x1db622a5518016L, - 0x0b7f9af0d575bfL, - 0x029e4c4db82240L, - 0x04961892f5d673L, - 0x02b291598e4589L, - 0x11388382c15694L, - 0x02dad977c9e1feL, - 0x191d96d4d334c6L] - self.gen.seed(61731L + (24903L<<32) + (614L<<64) + (42143L<<96)) + expected = [0x0eab3258d2231f, + 0x1b89db315277a5, + 0x1db622a5518016, + 0x0b7f9af0d575bf, + 0x029e4c4db82240, + 0x04961892f5d673, + 0x02b291598e4589, + 0x11388382c15694, + 0x02dad977c9e1fe, + 0x191d96d4d334c6] + self.gen.seed(61731 + (24903<<32) + (614<<64) + (42143<<96)) actual = self.randomlist(2000)[-10:] for a, e in zip(actual, expected): - self.assertEqual(long(ldexp(a, 53)), e) + self.assertEqual(int(ldexp(a, 53)), e) def test_long_seed(self): # This is most interesting to run in debug mode, just to make sure @@ -360,7 +360,7 @@ class MersenneTwister_TestBasicOps(TestBasicOps): # is allocated, consuming space proportional to the number of bits # in the seed. Unfortunately, that's a quadratic-time algorithm, # so don't make this horribly big. - seed = (1L << (10000 * 8)) - 1 # about 10K bytes + seed = (1 << (10000 * 8)) - 1 # about 10K bytes self.gen.seed(seed) def test_53_bits_per_float(self): @@ -399,7 +399,7 @@ class MersenneTwister_TestBasicOps(TestBasicOps): # Verify cross-platform repeatability self.gen.seed(1234567) self.assertEqual(self.gen.getrandbits(100), - 97904845777343510404718956115L) + 97904845777343510404718956115) # Verify ranges for k in xrange(1, 1000): self.assert_(0 <= self.gen.getrandbits(k) < 2**k) @@ -424,7 +424,7 @@ class MersenneTwister_TestBasicOps(TestBasicOps): # show that: k = int(1.001 + _log(n, 2)) # is equal to or one greater than the number of bits in n for i in xrange(1, 1000): - n = 1L << i # check an exact power of two + n = 1 << i # check an exact power of two numbits = i+1 k = int(1.00001 + _log(n, 2)) self.assertEqual(k, numbits) diff --git a/Lib/test/test_repr.py b/Lib/test/test_repr.py index 823298b..1435c6f 100644 --- a/Lib/test/test_repr.py +++ b/Lib/test/test_repr.py @@ -90,10 +90,10 @@ class ReprTests(unittest.TestCase): def test_numbers(self): eq = self.assertEquals eq(r(123), repr(123)) - eq(r(123L), repr(123L)) + eq(r(123), repr(123)) eq(r(1.0/3), repr(1.0/3)) - n = 10L**100 + n = 10**100 expected = repr(n)[:18] + "..." + repr(n)[-19:] eq(r(n), expected) diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py index 29ce35b..31aa370 100644 --- a/Lib/test/test_resource.py +++ b/Lib/test/test_resource.py @@ -45,7 +45,7 @@ finally: resource.setrlimit(resource.RLIMIT_FSIZE, (cur, max)) # And be sure that setrlimit is checking for really large values -too_big = 10L**50 +too_big = 10**50 try: resource.setrlimit(resource.RLIMIT_FSIZE, (too_big, max)) except (OverflowError, ValueError): diff --git a/Lib/test/test_slice.py b/Lib/test/test_slice.py index bd6e621..f22f619 100644 --- a/Lib/test/test_slice.py +++ b/Lib/test/test_slice.py @@ -86,11 +86,11 @@ class SliceTest(unittest.TestCase): slice(100, -100, -1).indices(10), slice(None, None, -1).indices(10) ) - self.assertEqual(slice(-100L, 100L, 2L).indices(10), (0, 10, 2)) + self.assertEqual(slice(-100, 100, 2).indices(10), (0, 10, 2)) self.assertEqual(range(10)[::sys.maxint - 1], [0]) - self.assertRaises(OverflowError, slice(None).indices, 1L<<100) + self.assertRaises(OverflowError, slice(None).indices, 1<<100) def test_main(): test_support.run_unittest(SliceTest) diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py index ecfb1ed..1f26b4e 100644 --- a/Lib/test/test_socket.py +++ b/Lib/test/test_socket.py @@ -302,17 +302,17 @@ class GeneralModuleTests(unittest.TestCase): sizes = {socket.htonl: 32, socket.ntohl: 32, socket.htons: 16, socket.ntohs: 16} for func, size in sizes.items(): - mask = (1L<<size) - 1 + mask = (1<<size) - 1 for i in (0, 1, 0xffff, ~0xffff, 2, 0x01234567, 0x76543210): self.assertEqual(i & mask, func(func(i&mask)) & mask) swapped = func(mask) self.assertEqual(swapped & mask, mask) - self.assertRaises(OverflowError, func, 1L<<34) + self.assertRaises(OverflowError, func, 1<<34) def testNtoHErrors(self): - good_values = [ 1, 2, 3, 1L, 2L, 3L ] - bad_values = [ -1, -2, -3, -1L, -2L, -3L ] + good_values = [ 1, 2, 3, 1, 2, 3 ] + bad_values = [ -1, -2, -3, -1, -2, -3 ] for k in good_values: socket.ntohl(k) socket.ntohs(k) diff --git a/Lib/test/test_strftime.py b/Lib/test/test_strftime.py index 00fa227..26bae1b 100755 --- a/Lib/test/test_strftime.py +++ b/Lib/test/test_strftime.py @@ -41,7 +41,7 @@ def escapestr(text, ampm): def strftest(now): if verbose: print "strftime test for", time.ctime(now) - nowsecs = str(long(now))[:-1] + nowsecs = str(int(now))[:-1] gmt = time.gmtime(now) now = time.localtime(now) diff --git a/Lib/test/test_string.py b/Lib/test/test_string.py index 6d5e8e4..6e9c122 100644 --- a/Lib/test/test_string.py +++ b/Lib/test/test_string.py @@ -83,7 +83,7 @@ class ModuleTest(unittest.TestCase): self.assertRaises(ValueError, string.atoi, " x1 ") def test_atol(self): - self.assertEqual(string.atol(" 1 "), 1L) + self.assertEqual(string.atol(" 1 "), 1) self.assertRaises(ValueError, string.atol, " 1x ") self.assertRaises(ValueError, string.atol, " x1 ") diff --git a/Lib/test/test_strop.py b/Lib/test/test_strop.py index 2ac7986..66e7eb6 100644 --- a/Lib/test/test_strop.py +++ b/Lib/test/test_strop.py @@ -15,7 +15,7 @@ class StropFunctionTestCase(unittest.TestCase): self.assertRaises(ValueError, strop.atoi, " x1 ") def test_atol(self): - self.assert_(strop.atol(" 1 ") == 1L) + self.assert_(strop.atol(" 1 ") == 1) self.assertRaises(ValueError, strop.atol, " 1x") self.assertRaises(ValueError, strop.atol, " x1 ") diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index d4744dd..f1bef4b 100644 --- a/Lib/test/test_struct.py +++ b/Lib/test/test_struct.py @@ -146,12 +146,12 @@ tests = [ ('H', 0x10000-700, '\375D', 'D\375', 0), ('i', 70000000, '\004,\035\200', '\200\035,\004', 0), ('i', -70000000, '\373\323\342\200', '\200\342\323\373', 0), - ('I', 70000000L, '\004,\035\200', '\200\035,\004', 0), - ('I', 0x100000000L-70000000, '\373\323\342\200', '\200\342\323\373', 0), + ('I', 70000000, '\004,\035\200', '\200\035,\004', 0), + ('I', 0x100000000-70000000, '\373\323\342\200', '\200\342\323\373', 0), ('l', 70000000, '\004,\035\200', '\200\035,\004', 0), ('l', -70000000, '\373\323\342\200', '\200\342\323\373', 0), - ('L', 70000000L, '\004,\035\200', '\200\035,\004', 0), - ('L', 0x100000000L-70000000, '\373\323\342\200', '\200\342\323\373', 0), + ('L', 70000000, '\004,\035\200', '\200\035,\004', 0), + ('L', 0x100000000-70000000, '\373\323\342\200', '\200\342\323\373', 0), ('f', 2.0, '@\000\000\000', '\000\000\000@', 0), ('d', 2.0, '@\000\000\000\000\000\000\000', '\000\000\000\000\000\000\000@', 0), @@ -203,9 +203,9 @@ def test_native_qQ(): ('q', -1, '\xff' * bytes), ('q', 0, '\x00' * bytes), ('Q', 0, '\x00' * bytes), - ('q', 1L, '\x00' * (bytes-1) + '\x01'), - ('Q', (1L << (8*bytes))-1, '\xff' * bytes), - ('q', (1L << (8*bytes-1))-1, '\x7f' + '\xff' * (bytes - 1))): + ('q', 1, '\x00' * (bytes-1) + '\x01'), + ('Q', (1 << (8*bytes))-1, '\xff' * bytes), + ('q', (1 << (8*bytes-1))-1, '\x7f' + '\xff' * (bytes - 1))): got = struct.pack(format, input) native_expected = bigendian_to_native(expected) verify(got == native_expected, @@ -243,9 +243,9 @@ class IntTester: self.bitsize = bytesize * 8 self.signed_code, self.unsigned_code = formatpair self.unsigned_min = 0 - self.unsigned_max = 2L**self.bitsize - 1 - self.signed_min = -(2L**(self.bitsize-1)) - self.signed_max = 2L**(self.bitsize-1) - 1 + self.unsigned_max = 2**self.bitsize - 1 + self.signed_min = -(2**(self.bitsize-1)) + self.signed_max = 2**(self.bitsize-1) - 1 def test_one(self, x, pack=struct.pack, unpack=struct.unpack, @@ -257,9 +257,9 @@ class IntTester: code = self.signed_code if self.signed_min <= x <= self.signed_max: # Try big-endian. - expected = long(x) + expected = int(x) if x < 0: - expected += 1L << self.bitsize + expected += 1 << self.bitsize assert expected > 0 expected = hex(expected)[2:] # chop "0x" if len(expected) & 1: @@ -316,7 +316,7 @@ class IntTester: if self.unsigned_min <= x <= self.unsigned_max: # Try big-endian. format = ">" + code - expected = long(x) + expected = int(x) expected = hex(expected)[2:] # chop "0x" if len(expected) & 1: expected = "0" + expected @@ -372,11 +372,11 @@ class IntTester: # Create all interesting powers of 2. values = [] for exp in range(self.bitsize + 3): - values.append(1L << exp) + values.append(1 << exp) # Add some random values. for i in range(self.bitsize): - val = 0L + val = 0 for j in range(self.bytesize): val = (val << 8) | randrange(256) values.append(val) @@ -485,15 +485,15 @@ test_705836() def test_1229380(): import sys for endian in ('', '>', '<'): - for cls in (int, long): + for cls in (int, int): for fmt in ('B', 'H', 'I', 'L'): deprecated_err(struct.pack, endian + fmt, cls(-1)) deprecated_err(struct.pack, endian + 'B', cls(300)) deprecated_err(struct.pack, endian + 'H', cls(70000)) - deprecated_err(struct.pack, endian + 'I', sys.maxint * 4L) - deprecated_err(struct.pack, endian + 'L', sys.maxint * 4L) + deprecated_err(struct.pack, endian + 'I', sys.maxint * 4) + deprecated_err(struct.pack, endian + 'L', sys.maxint * 4) if PY_STRUCT_RANGE_CHECKING: test_1229380() diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index 18129da..3a7fa0f 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -20,8 +20,8 @@ class TimeTestCase(unittest.TestCase): def test_conversions(self): self.assert_(time.ctime(self.t) == time.asctime(time.localtime(self.t))) - self.assert_(long(time.mktime(time.localtime(self.t))) - == long(self.t)) + self.assert_(int(time.mktime(time.localtime(self.t))) + == int(self.t)) def test_sleep(self): time.sleep(1.2) diff --git a/Lib/test/test_timeout.py b/Lib/test/test_timeout.py index 2b32b92..94765d9 100644 --- a/Lib/test/test_timeout.py +++ b/Lib/test/test_timeout.py @@ -46,7 +46,7 @@ class CreationTestCase(unittest.TestCase): def testTypeCheck(self): # Test type checking by settimeout() self.sock.settimeout(0) - self.sock.settimeout(0L) + self.sock.settimeout(0) self.sock.settimeout(0.0) self.sock.settimeout(None) self.assertRaises(TypeError, self.sock.settimeout, "") @@ -59,7 +59,7 @@ class CreationTestCase(unittest.TestCase): def testRangeCheck(self): # Test range checking by settimeout() self.assertRaises(ValueError, self.sock.settimeout, -1) - self.assertRaises(ValueError, self.sock.settimeout, -1L) + self.assertRaises(ValueError, self.sock.settimeout, -1) self.assertRaises(ValueError, self.sock.settimeout, -1.0) def testTimeoutThenBlocking(self): diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py index 8d26914..f5970ba 100644 --- a/Lib/test/test_types.py +++ b/Lib/test/test_types.py @@ -9,11 +9,11 @@ class TypesTests(unittest.TestCase): def test_truth_values(self): if None: self.fail('None is true instead of false') if 0: self.fail('0 is true instead of false') - if 0L: self.fail('0L is true instead of false') + if 0: self.fail('0L is true instead of false') if 0.0: self.fail('0.0 is true instead of false') if '': self.fail('\'\' is true instead of false') if not 1: self.fail('1 is false instead of true') - if not 1L: self.fail('1L is false instead of true') + if not 1: self.fail('1L is false instead of true') if not 1.0: self.fail('1.0 is false instead of true') if not 'x': self.fail('\'x\' is false instead of true') if not {'x': 1}: self.fail('{\'x\': 1} is false instead of true') @@ -35,7 +35,7 @@ class TypesTests(unittest.TestCase): def test_comparisons(self): if 0 < 1 <= 1 == 1 >= 1 > 0 != 1: pass else: self.fail('int comparisons failed') - if 0L < 1L <= 1L == 1L >= 1L > 0L != 1L: pass + if 0 < 1 <= 1 == 1 >= 1 > 0 != 1: pass else: self.fail('long int comparisons failed') if 0.0 < 1.0 <= 1.0 == 1.0 >= 1.0 > 0.0 != 1.0: pass else: self.fail('float comparisons failed') @@ -61,30 +61,30 @@ class TypesTests(unittest.TestCase): except ZeroDivisionError: pass else: self.fail("5.0 % 0.0 didn't raise ZeroDivisionError") - try: 5 / 0L + try: 5 / 0 except ZeroDivisionError: pass else: self.fail("5 / 0L didn't raise ZeroDivisionError") - try: 5 // 0L + try: 5 // 0 except ZeroDivisionError: pass else: self.fail("5 // 0L didn't raise ZeroDivisionError") - try: 5 % 0L + try: 5 % 0 except ZeroDivisionError: pass else: self.fail("5 % 0L didn't raise ZeroDivisionError") def test_numeric_types(self): - if 0 != 0L or 0 != 0.0 or 0L != 0.0: self.fail('mixed comparisons') - if 1 != 1L or 1 != 1.0 or 1L != 1.0: self.fail('mixed comparisons') - if -1 != -1L or -1 != -1.0 or -1L != -1.0: + if 0 != 0 or 0 != 0.0 or 0 != 0.0: self.fail('mixed comparisons') + if 1 != 1 or 1 != 1.0 or 1 != 1.0: self.fail('mixed comparisons') + if -1 != -1 or -1 != -1.0 or -1 != -1.0: self.fail('int/long/float value not equal') # calling built-in types without argument must return 0 if int() != 0: self.fail('int() does not return 0') - if long() != 0L: self.fail('long() does not return 0L') + if int() != 0: self.fail('long() does not return 0L') if float() != 0.0: self.fail('float() does not return 0.0') if int(1.9) == 1 == int(1.1) and int(-1.1) == -1 == int(-1.9): pass else: self.fail('int() does not round properly') - if long(1.9) == 1L == long(1.1) and long(-1.1) == -1L == long(-1.9): pass + if int(1.9) == 1 == int(1.1) and int(-1.1) == -1 == int(-1.9): pass else: self.fail('long() does not round properly') if float(1) == 1.0 and float(-1) == -1.0 and float(0) == 0.0: pass else: self.fail('float() does not work properly') @@ -118,7 +118,7 @@ class TypesTests(unittest.TestCase): for divisor in 1, 2, 4, 8, 16, 32: j = m // divisor - 1 prod = divisor * j - if type(prod) is not long: + if type(prod) is not int: self.fail("expected type(%r) to be long, not %r" % (prod, type(prod))) # Check for expected * overflow to long. @@ -126,35 +126,35 @@ class TypesTests(unittest.TestCase): for divisor in 1, 2, 4, 8, 16, 32: j = m // divisor + 1 prod = divisor * j - if type(prod) is not long: + if type(prod) is not int: self.fail("expected type(%r) to be long, not %r" % (prod, type(prod))) def test_long_integers(self): - if 12L + 24L != 36L: self.fail('long op') - if 12L + (-24L) != -12L: self.fail('long op') - if (-12L) + 24L != 12L: self.fail('long op') - if (-12L) + (-24L) != -36L: self.fail('long op') - if not 12L < 24L: self.fail('long op') - if not -24L < -12L: self.fail('long op') + if 12 + 24 != 36: self.fail('long op') + if 12 + (-24) != -12: self.fail('long op') + if (-12) + 24 != 12: self.fail('long op') + if (-12) + (-24) != -36: self.fail('long op') + if not 12 < 24: self.fail('long op') + if not -24 < -12: self.fail('long op') x = sys.maxint - if int(long(x)) != x: self.fail('long op') - try: y = int(long(x)+1L) + if int(int(x)) != x: self.fail('long op') + try: y = int(int(x)+1) except OverflowError: self.fail('long op') - if not isinstance(y, long): self.fail('long op') + if not isinstance(y, int): self.fail('long op') x = -x - if int(long(x)) != x: self.fail('long op') + if int(int(x)) != x: self.fail('long op') x = x-1 - if int(long(x)) != x: self.fail('long op') - try: y = int(long(x)-1L) + if int(int(x)) != x: self.fail('long op') + try: y = int(int(x)-1) except OverflowError: self.fail('long op') - if not isinstance(y, long): self.fail('long op') + if not isinstance(y, int): self.fail('long op') try: 5 << -5 except ValueError: pass else: self.fail('int negative shift <<') - try: 5L << -5L + try: 5 << -5 except ValueError: pass else: self.fail('long negative shift <<') @@ -162,7 +162,7 @@ class TypesTests(unittest.TestCase): except ValueError: pass else: self.fail('int negative shift >>') - try: 5L >> -5L + try: 5 >> -5 except ValueError: pass else: self.fail('long negative shift >>') @@ -197,7 +197,7 @@ class TypesTests(unittest.TestCase): self.assertEqual(a[3::-2], '31') self.assertEqual(a[-100:100:], a) self.assertEqual(a[100:-100:-1], a[::-1]) - self.assertEqual(a[-100L:100L:2L], '02468') + self.assertEqual(a[-100:100:2], '02468') if have_unicode: a = unicode('0123456789', 'ascii') @@ -209,7 +209,7 @@ class TypesTests(unittest.TestCase): self.assertEqual(a[3::-2], unicode('31', 'ascii')) self.assertEqual(a[-100:100:], a) self.assertEqual(a[100:-100:-1], a[::-1]) - self.assertEqual(a[-100L:100L:2L], unicode('02468', 'ascii')) + self.assertEqual(a[-100:100:2], unicode('02468', 'ascii')) def test_type_function(self): diff --git a/Lib/test/test_unary.py b/Lib/test/test_unary.py index 9854f64..1e07c15 100644 --- a/Lib/test/test_unary.py +++ b/Lib/test/test_unary.py @@ -9,7 +9,7 @@ class UnaryOpTestCase(unittest.TestCase): self.assert_(-2 == 0 - 2) self.assert_(-0 == 0) self.assert_(--2 == 2) - self.assert_(-2L == 0 - 2L) + self.assert_(-2 == 0 - 2) self.assert_(-2.0 == 0 - 2.0) self.assert_(-2j == 0 - 2j) @@ -17,7 +17,7 @@ class UnaryOpTestCase(unittest.TestCase): self.assert_(+2 == 2) self.assert_(+0 == 0) self.assert_(++2 == 2) - self.assert_(+2L == 2L) + self.assert_(+2 == 2) self.assert_(+2.0 == 2.0) self.assert_(+2j == 2j) @@ -25,13 +25,13 @@ class UnaryOpTestCase(unittest.TestCase): self.assert_(-2 == 0 - 2) self.assert_(-0 == 0) self.assert_(--2 == 2) - self.assert_(-2L == 0 - 2L) + self.assert_(-2 == 0 - 2) def test_no_overflow(self): nines = "9" * 32 - self.assert_(eval("+" + nines) == eval("+" + nines + "L")) - self.assert_(eval("-" + nines) == eval("-" + nines + "L")) - self.assert_(eval("~" + nines) == eval("~" + nines + "L")) + self.assert_(eval("+" + nines) == 10**32-1) + self.assert_(eval("-" + nines) == -(10**32-1)) + self.assert_(eval("~" + nines) == ~(10**32-1)) def test_negation_of_exponentiation(self): # Make sure '**' does the right thing; these form a diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py index 38ff9ac..5c70df1 100644 --- a/Lib/test/test_unicode.py +++ b/Lib/test/test_unicode.py @@ -483,7 +483,7 @@ class UnicodeTest( UnicodeCompat(u"u'%s' % obj falls back to obj.__str__()"), u"u'%s' % obj falls back to obj.__str__()") - for obj in (123, 123.45, 123L): + for obj in (123, 123.45, 123): self.assertEqual(unicode(obj), unicode(str(obj))) # unicode(obj, encoding, error) tests (this maps to diff --git a/Lib/test/test_uuid.py b/Lib/test/test_uuid.py index 90671be..f1d1d1c 100644 --- a/Lib/test/test_uuid.py +++ b/Lib/test/test_uuid.py @@ -32,19 +32,19 @@ class TestUUID(TestCase): '000102030405060708090a0b0c0d0e0f', '\0\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\x0d\x0e\x0f', '\x03\x02\x01\0\x05\x04\x07\x06\x08\t\n\x0b\x0c\x0d\x0e\x0f', - (0x00010203L, 0x0405, 0x0607, 8, 9, 0x0a0b0c0d0e0fL), - 0x000102030405060708090a0b0c0d0e0fL, + (0x00010203, 0x0405, 0x0607, 8, 9, 0x0a0b0c0d0e0f), + 0x000102030405060708090a0b0c0d0e0f, 'urn:uuid:00010203-0405-0607-0809-0a0b0c0d0e0f', - 0x607040500010203L, 0x809, uuid.RESERVED_NCS, None), + 0x607040500010203, 0x809, uuid.RESERVED_NCS, None), ('02d9e6d5-9467-382e-8f9b-9300a64ac3cd', '{02d9e6d5-9467-382e-8f9b-9300a64ac3cd}', '02d9e6d59467382e8f9b9300a64ac3cd', '\x02\xd9\xe6\xd5\x94\x67\x38\x2e\x8f\x9b\x93\x00\xa6\x4a\xc3\xcd', '\xd5\xe6\xd9\x02\x67\x94\x2e\x38\x8f\x9b\x93\x00\xa6\x4a\xc3\xcd', - (0x02d9e6d5L, 0x9467, 0x382e, 0x8f, 0x9b, 0x9300a64ac3cdL), - 0x02d9e6d59467382e8f9b9300a64ac3cdL, + (0x02d9e6d5, 0x9467, 0x382e, 0x8f, 0x9b, 0x9300a64ac3cd), + 0x02d9e6d59467382e8f9b9300a64ac3cd, 'urn:uuid:02d9e6d5-9467-382e-8f9b-9300a64ac3cd', - 0x82e946702d9e6d5L, 0xf9b, uuid.RFC_4122, 3), + 0x82e946702d9e6d5, 0xf9b, uuid.RFC_4122, 3), ('12345678-1234-5678-1234-567812345678', '{12345678-1234-5678-1234-567812345678}', '12345678123456781234567812345678', @@ -53,97 +53,97 @@ class TestUUID(TestCase): (0x12345678, 0x1234, 0x5678, 0x12, 0x34, 0x567812345678), 0x12345678123456781234567812345678, 'urn:uuid:12345678-1234-5678-1234-567812345678', - 0x678123412345678L, 0x1234, uuid.RESERVED_NCS, None), + 0x678123412345678, 0x1234, uuid.RESERVED_NCS, None), ('6ba7b810-9dad-11d1-80b4-00c04fd430c8', '{6ba7b810-9dad-11d1-80b4-00c04fd430c8}', '6ba7b8109dad11d180b400c04fd430c8', '\x6b\xa7\xb8\x10\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', '\x10\xb8\xa7\x6b\xad\x9d\xd1\x11\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', - (0x6ba7b810L, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8L), - 0x6ba7b8109dad11d180b400c04fd430c8L, + (0x6ba7b810, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8), + 0x6ba7b8109dad11d180b400c04fd430c8, 'urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8', - 0x1d19dad6ba7b810L, 0xb4, uuid.RFC_4122, 1), + 0x1d19dad6ba7b810, 0xb4, uuid.RFC_4122, 1), ('6ba7b811-9dad-11d1-80b4-00c04fd430c8', '{6ba7b811-9dad-11d1-80b4-00c04fd430c8}', '6ba7b8119dad11d180b400c04fd430c8', '\x6b\xa7\xb8\x11\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', '\x11\xb8\xa7\x6b\xad\x9d\xd1\x11\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', - (0x6ba7b811L, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8L), - 0x6ba7b8119dad11d180b400c04fd430c8L, + (0x6ba7b811, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8), + 0x6ba7b8119dad11d180b400c04fd430c8, 'urn:uuid:6ba7b811-9dad-11d1-80b4-00c04fd430c8', - 0x1d19dad6ba7b811L, 0xb4, uuid.RFC_4122, 1), + 0x1d19dad6ba7b811, 0xb4, uuid.RFC_4122, 1), ('6ba7b812-9dad-11d1-80b4-00c04fd430c8', '{6ba7b812-9dad-11d1-80b4-00c04fd430c8}', '6ba7b8129dad11d180b400c04fd430c8', '\x6b\xa7\xb8\x12\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', '\x12\xb8\xa7\x6b\xad\x9d\xd1\x11\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', - (0x6ba7b812L, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8L), - 0x6ba7b8129dad11d180b400c04fd430c8L, + (0x6ba7b812, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8), + 0x6ba7b8129dad11d180b400c04fd430c8, 'urn:uuid:6ba7b812-9dad-11d1-80b4-00c04fd430c8', - 0x1d19dad6ba7b812L, 0xb4, uuid.RFC_4122, 1), + 0x1d19dad6ba7b812, 0xb4, uuid.RFC_4122, 1), ('6ba7b814-9dad-11d1-80b4-00c04fd430c8', '{6ba7b814-9dad-11d1-80b4-00c04fd430c8}', '6ba7b8149dad11d180b400c04fd430c8', '\x6b\xa7\xb8\x14\x9d\xad\x11\xd1\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', '\x14\xb8\xa7\x6b\xad\x9d\xd1\x11\x80\xb4\x00\xc0\x4f\xd4\x30\xc8', - (0x6ba7b814L, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8L), - 0x6ba7b8149dad11d180b400c04fd430c8L, + (0x6ba7b814, 0x9dad, 0x11d1, 0x80, 0xb4, 0x00c04fd430c8), + 0x6ba7b8149dad11d180b400c04fd430c8, 'urn:uuid:6ba7b814-9dad-11d1-80b4-00c04fd430c8', - 0x1d19dad6ba7b814L, 0xb4, uuid.RFC_4122, 1), + 0x1d19dad6ba7b814, 0xb4, uuid.RFC_4122, 1), ('7d444840-9dc0-11d1-b245-5ffdce74fad2', '{7d444840-9dc0-11d1-b245-5ffdce74fad2}', '7d4448409dc011d1b2455ffdce74fad2', '\x7d\x44\x48\x40\x9d\xc0\x11\xd1\xb2\x45\x5f\xfd\xce\x74\xfa\xd2', '\x40\x48\x44\x7d\xc0\x9d\xd1\x11\xb2\x45\x5f\xfd\xce\x74\xfa\xd2', - (0x7d444840L, 0x9dc0, 0x11d1, 0xb2, 0x45, 0x5ffdce74fad2L), - 0x7d4448409dc011d1b2455ffdce74fad2L, + (0x7d444840, 0x9dc0, 0x11d1, 0xb2, 0x45, 0x5ffdce74fad2), + 0x7d4448409dc011d1b2455ffdce74fad2, 'urn:uuid:7d444840-9dc0-11d1-b245-5ffdce74fad2', - 0x1d19dc07d444840L, 0x3245, uuid.RFC_4122, 1), + 0x1d19dc07d444840, 0x3245, uuid.RFC_4122, 1), ('e902893a-9d22-3c7e-a7b8-d6e313b71d9f', '{e902893a-9d22-3c7e-a7b8-d6e313b71d9f}', 'e902893a9d223c7ea7b8d6e313b71d9f', '\xe9\x02\x89\x3a\x9d\x22\x3c\x7e\xa7\xb8\xd6\xe3\x13\xb7\x1d\x9f', '\x3a\x89\x02\xe9\x22\x9d\x7e\x3c\xa7\xb8\xd6\xe3\x13\xb7\x1d\x9f', - (0xe902893aL, 0x9d22, 0x3c7e, 0xa7, 0xb8, 0xd6e313b71d9fL), - 0xe902893a9d223c7ea7b8d6e313b71d9fL, + (0xe902893a, 0x9d22, 0x3c7e, 0xa7, 0xb8, 0xd6e313b71d9f), + 0xe902893a9d223c7ea7b8d6e313b71d9f, 'urn:uuid:e902893a-9d22-3c7e-a7b8-d6e313b71d9f', - 0xc7e9d22e902893aL, 0x27b8, uuid.RFC_4122, 3), + 0xc7e9d22e902893a, 0x27b8, uuid.RFC_4122, 3), ('eb424026-6f54-4ef8-a4d0-bb658a1fc6cf', '{eb424026-6f54-4ef8-a4d0-bb658a1fc6cf}', 'eb4240266f544ef8a4d0bb658a1fc6cf', '\xeb\x42\x40\x26\x6f\x54\x4e\xf8\xa4\xd0\xbb\x65\x8a\x1f\xc6\xcf', '\x26\x40\x42\xeb\x54\x6f\xf8\x4e\xa4\xd0\xbb\x65\x8a\x1f\xc6\xcf', - (0xeb424026L, 0x6f54, 0x4ef8, 0xa4, 0xd0, 0xbb658a1fc6cfL), - 0xeb4240266f544ef8a4d0bb658a1fc6cfL, + (0xeb424026, 0x6f54, 0x4ef8, 0xa4, 0xd0, 0xbb658a1fc6cf), + 0xeb4240266f544ef8a4d0bb658a1fc6cf, 'urn:uuid:eb424026-6f54-4ef8-a4d0-bb658a1fc6cf', - 0xef86f54eb424026L, 0x24d0, uuid.RFC_4122, 4), + 0xef86f54eb424026, 0x24d0, uuid.RFC_4122, 4), ('f81d4fae-7dec-11d0-a765-00a0c91e6bf6', '{f81d4fae-7dec-11d0-a765-00a0c91e6bf6}', 'f81d4fae7dec11d0a76500a0c91e6bf6', '\xf8\x1d\x4f\xae\x7d\xec\x11\xd0\xa7\x65\x00\xa0\xc9\x1e\x6b\xf6', '\xae\x4f\x1d\xf8\xec\x7d\xd0\x11\xa7\x65\x00\xa0\xc9\x1e\x6b\xf6', - (0xf81d4faeL, 0x7dec, 0x11d0, 0xa7, 0x65, 0x00a0c91e6bf6L), - 0xf81d4fae7dec11d0a76500a0c91e6bf6L, + (0xf81d4fae, 0x7dec, 0x11d0, 0xa7, 0x65, 0x00a0c91e6bf6), + 0xf81d4fae7dec11d0a76500a0c91e6bf6, 'urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6', - 0x1d07decf81d4faeL, 0x2765, uuid.RFC_4122, 1), + 0x1d07decf81d4fae, 0x2765, uuid.RFC_4122, 1), ('fffefdfc-fffe-fffe-fffe-fffefdfcfbfa', '{fffefdfc-fffe-fffe-fffe-fffefdfcfbfa}', 'fffefdfcfffefffefffefffefdfcfbfa', '\xff\xfe\xfd\xfc\xff\xfe\xff\xfe\xff\xfe\xff\xfe\xfd\xfc\xfb\xfa', '\xfc\xfd\xfe\xff\xfe\xff\xfe\xff\xff\xfe\xff\xfe\xfd\xfc\xfb\xfa', - (0xfffefdfcL, 0xfffe, 0xfffe, 0xff, 0xfe, 0xfffefdfcfbfaL), - 0xfffefdfcfffefffefffefffefdfcfbfaL, + (0xfffefdfc, 0xfffe, 0xfffe, 0xff, 0xfe, 0xfffefdfcfbfa), + 0xfffefdfcfffefffefffefffefdfcfbfa, 'urn:uuid:fffefdfc-fffe-fffe-fffe-fffefdfcfbfa', - 0xffefffefffefdfcL, 0x3ffe, uuid.RESERVED_FUTURE, None), + 0xffefffefffefdfc, 0x3ffe, uuid.RESERVED_FUTURE, None), ('ffffffff-ffff-ffff-ffff-ffffffffffff', '{ffffffff-ffff-ffff-ffff-ffffffffffff}', 'ffffffffffffffffffffffffffffffff', '\xff'*16, '\xff'*16, - (0xffffffffL, 0xffffL, 0xffffL, 0xff, 0xff, 0xffffffffffffL), - 0xffffffffffffffffffffffffffffffffL, + (0xffffffff, 0xffff, 0xffff, 0xff, 0xff, 0xffffffffffff), + 0xffffffffffffffffffffffffffffffff, 'urn:uuid:ffffffff-ffff-ffff-ffff-ffffffffffff', - 0xfffffffffffffffL, 0x3fff, uuid.RESERVED_FUTURE, None), + 0xfffffffffffffff, 0x3fff, uuid.RESERVED_FUTURE, None), ]: equivalents = [] # Construct each UUID in several different ways. @@ -217,17 +217,17 @@ class TestUUID(TestCase): # Field values out of range. badvalue(lambda: uuid.UUID(fields=(-1, 0, 0, 0, 0, 0))) - badvalue(lambda: uuid.UUID(fields=(0x100000000L, 0, 0, 0, 0, 0))) + badvalue(lambda: uuid.UUID(fields=(0x100000000, 0, 0, 0, 0, 0))) badvalue(lambda: uuid.UUID(fields=(0, -1, 0, 0, 0, 0))) - badvalue(lambda: uuid.UUID(fields=(0, 0x10000L, 0, 0, 0, 0))) + badvalue(lambda: uuid.UUID(fields=(0, 0x10000, 0, 0, 0, 0))) badvalue(lambda: uuid.UUID(fields=(0, 0, -1, 0, 0, 0))) - badvalue(lambda: uuid.UUID(fields=(0, 0, 0x10000L, 0, 0, 0))) + badvalue(lambda: uuid.UUID(fields=(0, 0, 0x10000, 0, 0, 0))) badvalue(lambda: uuid.UUID(fields=(0, 0, 0, -1, 0, 0))) - badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0x100L, 0, 0))) + badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0x100, 0, 0))) badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0, -1, 0))) - badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0, 0x100L, 0))) + badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0, 0x100, 0))) badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0, 0, -1))) - badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0, 0, 0x1000000000000L))) + badvalue(lambda: uuid.UUID(fields=(0, 0, 0, 0, 0, 0x1000000000000))) # Version number out of range. badvalue(lambda: uuid.UUID('00'*16, version=0)) @@ -235,7 +235,7 @@ class TestUUID(TestCase): # Integer value out of range. badvalue(lambda: uuid.UUID(int=-1)) - badvalue(lambda: uuid.UUID(int=1<<128L)) + badvalue(lambda: uuid.UUID(int=1<<128)) # Must supply exactly one of hex, bytes, fields, int. h, b, f, i = '00'*16, '\0'*16, (0, 0, 0, 0, 0, 0), 0 @@ -281,15 +281,15 @@ class TestUUID(TestCase): badtype(lambda: setattr(u, 'node', 0)) def check_node(self, node, source): - individual_group_bit = (node >> 40L) & 1 - universal_local_bit = (node >> 40L) & 2 + individual_group_bit = (node >> 40) & 1 + universal_local_bit = (node >> 40) & 2 message = "%012x doesn't look like a real MAC address" % node self.assertEqual(individual_group_bit, 0, message) self.assertEqual(universal_local_bit, 0, message) self.assertNotEqual(node, 0, message) - self.assertNotEqual(node, 0xffffffffffffL, message) + self.assertNotEqual(node, 0xffffffffffff, message) self.assert_(0 <= node, message) - self.assert_(node < (1L << 48), message) + self.assert_(node < (1 << 48), message) TestUUID.source2node[source] = node if TestUUID.last_node: @@ -332,7 +332,7 @@ class TestUUID(TestCase): def test_random_getnode(self): node = uuid._random_getnode() self.assert_(0 <= node) - self.assert_(node < (1L <<48)) + self.assert_(node < (1 <<48)) def test_unixdll_getnode(self): import sys diff --git a/Lib/test/test_xdrlib.py b/Lib/test/test_xdrlib.py index 8fc88a5..97f0cc9 100644 --- a/Lib/test/test_xdrlib.py +++ b/Lib/test/test_xdrlib.py @@ -15,7 +15,7 @@ class XDRTest(unittest.TestCase): p.pack_uint(9) p.pack_bool(True) p.pack_bool(False) - p.pack_uhyper(45L) + p.pack_uhyper(45) p.pack_float(1.9) p.pack_double(1.9) p.pack_string(s) @@ -40,7 +40,7 @@ class XDRTest(unittest.TestCase): up.set_position(pos) self.assert_(up.unpack_bool() is False) - self.assertEqual(up.unpack_uhyper(), 45L) + self.assertEqual(up.unpack_uhyper(), 45) self.assertAlmostEqual(up.unpack_float(), 1.9) self.assertAlmostEqual(up.unpack_double(), 1.9) self.assertEqual(up.unpack_string(), s) diff --git a/Lib/test/test_xmlrpc.py b/Lib/test/test_xmlrpc.py index ccc1b60..795e097 100644 --- a/Lib/test/test_xmlrpc.py +++ b/Lib/test/test_xmlrpc.py @@ -14,7 +14,7 @@ else: alist = [{'astring': 'foo@bar.baz.spam', 'afloat': 7283.43, 'anint': 2**20, - 'ashortlong': 2L, + 'ashortlong': 2, 'anotherlist': ['.zyx.41'], 'abase64': xmlrpclib.Binary("my dog has fleas"), 'boolean': xmlrpclib.False, @@ -96,15 +96,15 @@ class XMLRPCTestCase(unittest.TestCase): self.assertEquals(t2, t.__dict__) def test_dump_big_long(self): - self.assertRaises(OverflowError, xmlrpclib.dumps, (2L**99,)) + self.assertRaises(OverflowError, xmlrpclib.dumps, (2**99,)) def test_dump_bad_dict(self): self.assertRaises(TypeError, xmlrpclib.dumps, ({(1,2,3): 1},)) def test_dump_big_int(self): - if sys.maxint > 2L**31-1: + if sys.maxint > 2**31-1: self.assertRaises(OverflowError, xmlrpclib.dumps, - (int(2L**34),)) + (int(2**34),)) def test_dump_none(self): value = alist + [None] diff --git a/Lib/test/test_xrange.py b/Lib/test/test_xrange.py index c0d1dbe..5225250 100644 --- a/Lib/test/test_xrange.py +++ b/Lib/test/test_xrange.py @@ -21,7 +21,7 @@ class XrangeTest(unittest.TestCase): c = 50 self.assertEqual(list(xrange(a, a+2)), [a, a+1]) - self.assertEqual(list(xrange(a+2, a, -1L)), [a+2, a+1]) + self.assertEqual(list(xrange(a+2, a, -1)), [a+2, a+1]) self.assertEqual(list(xrange(a+4, a, -2)), [a+4, a+2]) seq = list(xrange(a, b, c)) diff --git a/Lib/test/test_zipimport.py b/Lib/test/test_zipimport.py index 4e1a845..53c5504 100644 --- a/Lib/test/test_zipimport.py +++ b/Lib/test/test_zipimport.py @@ -31,7 +31,7 @@ def make_pyc(co, mtime): if mtime < 0x7fffffff: mtime = int(mtime) else: - mtime = int(-0x100000000L + long(mtime)) + mtime = int(-0x100000000 + int(mtime)) pyc = imp.get_magic() + struct.pack("<i", int(mtime)) + data return pyc diff --git a/Lib/test/test_zlib.py b/Lib/test/test_zlib.py index 4440942..0be9668 100644 --- a/Lib/test/test_zlib.py +++ b/Lib/test/test_zlib.py @@ -43,10 +43,10 @@ class ChecksumTestCase(unittest.TestCase): def assertEqual32(self, seen, expected): # 32-bit values masked -- checksums on 32- vs 64- bit machines # This is important if bit 31 (0x08000000L) is set. - self.assertEqual(seen & 0x0FFFFFFFFL, expected & 0x0FFFFFFFFL) + self.assertEqual(seen & 0x0FFFFFFFF, expected & 0x0FFFFFFFF) def test_penguins(self): - self.assertEqual32(zlib.crc32("penguin", 0), 0x0e5c1a120L) + self.assertEqual32(zlib.crc32("penguin", 0), 0x0e5c1a120) self.assertEqual32(zlib.crc32("penguin", 1), 0x43b6aa94) self.assertEqual32(zlib.adler32("penguin", 0), 0x0bcf02f6) self.assertEqual32(zlib.adler32("penguin", 1), 0x0bd602f7) diff --git a/Lib/types.py b/Lib/types.py index 5a89ad1..cc0c1d3 100644 --- a/Lib/types.py +++ b/Lib/types.py @@ -14,7 +14,7 @@ TypeType = type ObjectType = object IntType = int -LongType = long +LongType = int FloatType = float BooleanType = bool try: diff --git a/Lib/uuid.py b/Lib/uuid.py index 5bf5c35..3d4572c 100644 --- a/Lib/uuid.py +++ b/Lib/uuid.py @@ -50,6 +50,8 @@ RESERVED_NCS, RFC_4122, RESERVED_MICROSOFT, RESERVED_FUTURE = [ 'reserved for NCS compatibility', 'specified in RFC 4122', 'reserved for Microsoft compatibility', 'reserved for future definition'] +int_ = int # The built-in int function + class UUID(object): """Instances of the UUID class represent UUIDs as specified in RFC 4122. UUID objects are immutable, hashable, and usable as dictionary keys. @@ -132,7 +134,7 @@ class UUID(object): hex = hex.strip('{}').replace('-', '') if len(hex) != 32: raise ValueError('badly formed hexadecimal UUID string') - int = long(hex, 16) + int = int_(hex, 16) if bytes_le is not None: if len(bytes_le) != 16: raise ValueError('bytes_le is not a 16-char string') @@ -142,39 +144,39 @@ class UUID(object): if bytes is not None: if len(bytes) != 16: raise ValueError('bytes is not a 16-char string') - int = long(('%02x'*16) % tuple(map(ord, bytes)), 16) + int = int_(('%02x'*16) % tuple(map(ord, bytes)), 16) if fields is not None: if len(fields) != 6: raise ValueError('fields is not a 6-tuple') (time_low, time_mid, time_hi_version, clock_seq_hi_variant, clock_seq_low, node) = fields - if not 0 <= time_low < 1<<32L: + if not 0 <= time_low < 1<<32: raise ValueError('field 1 out of range (need a 32-bit value)') - if not 0 <= time_mid < 1<<16L: + if not 0 <= time_mid < 1<<16: raise ValueError('field 2 out of range (need a 16-bit value)') - if not 0 <= time_hi_version < 1<<16L: + if not 0 <= time_hi_version < 1<<16: raise ValueError('field 3 out of range (need a 16-bit value)') - if not 0 <= clock_seq_hi_variant < 1<<8L: + if not 0 <= clock_seq_hi_variant < 1<<8: raise ValueError('field 4 out of range (need an 8-bit value)') - if not 0 <= clock_seq_low < 1<<8L: + if not 0 <= clock_seq_low < 1<<8: raise ValueError('field 5 out of range (need an 8-bit value)') - if not 0 <= node < 1<<48L: + if not 0 <= node < 1<<48: raise ValueError('field 6 out of range (need a 48-bit value)') - clock_seq = (clock_seq_hi_variant << 8L) | clock_seq_low - int = ((time_low << 96L) | (time_mid << 80L) | - (time_hi_version << 64L) | (clock_seq << 48L) | node) + clock_seq = (clock_seq_hi_variant << 8) | clock_seq_low + int = ((time_low << 96) | (time_mid << 80) | + (time_hi_version << 64) | (clock_seq << 48) | node) if int is not None: - if not 0 <= int < 1<<128L: + if not 0 <= int < 1<<128: raise ValueError('int is out of range (need a 128-bit value)') if version is not None: if not 1 <= version <= 5: raise ValueError('illegal version number') # Set the variant to RFC 4122. - int &= ~(0xc000 << 48L) - int |= 0x8000 << 48L + int &= ~(0xc000 << 48) + int |= 0x8000 << 48 # Set the version number. - int &= ~(0xf000 << 64L) - int |= version << 76L + int &= ~(0xf000 << 64) + int |= version << 76 self.__dict__['int'] = int def __eq__(self, other): @@ -248,38 +250,38 @@ class UUID(object): fields = property(get_fields) def get_time_low(self): - return self.int >> 96L + return self.int >> 96 time_low = property(get_time_low) def get_time_mid(self): - return (self.int >> 80L) & 0xffff + return (self.int >> 80) & 0xffff time_mid = property(get_time_mid) def get_time_hi_version(self): - return (self.int >> 64L) & 0xffff + return (self.int >> 64) & 0xffff time_hi_version = property(get_time_hi_version) def get_clock_seq_hi_variant(self): - return (self.int >> 56L) & 0xff + return (self.int >> 56) & 0xff clock_seq_hi_variant = property(get_clock_seq_hi_variant) def get_clock_seq_low(self): - return (self.int >> 48L) & 0xff + return (self.int >> 48) & 0xff clock_seq_low = property(get_clock_seq_low) def get_time(self): - return (((self.time_hi_version & 0x0fffL) << 48L) | - (self.time_mid << 32L) | self.time_low) + return (((self.time_hi_version & 0x0fff) << 48) | + (self.time_mid << 32) | self.time_low) time = property(get_time) def get_clock_seq(self): - return (((self.clock_seq_hi_variant & 0x3fL) << 8L) | + return (((self.clock_seq_hi_variant & 0x3f) << 8) | self.clock_seq_low) clock_seq = property(get_clock_seq) @@ -300,11 +302,11 @@ class UUID(object): urn = property(get_urn) def get_variant(self): - if not self.int & (0x8000 << 48L): + if not self.int & (0x8000 << 48): return RESERVED_NCS - elif not self.int & (0x4000 << 48L): + elif not self.int & (0x4000 << 48): return RFC_4122 - elif not self.int & (0x2000 << 48L): + elif not self.int & (0x2000 << 48): return RESERVED_MICROSOFT else: return RESERVED_FUTURE @@ -314,7 +316,7 @@ class UUID(object): def get_version(self): # The version bits are only meaningful for RFC 4122 UUIDs. if self.variant == RFC_4122: - return int((self.int >> 76L) & 0xf) + return int((self.int >> 76) & 0xf) version = property(get_version) @@ -411,8 +413,8 @@ def _netbios_getnode(): continue status._unpack() bytes = map(ord, status.adapter_address) - return ((bytes[0]<<40L) + (bytes[1]<<32L) + (bytes[2]<<24L) + - (bytes[3]<<16L) + (bytes[4]<<8L) + bytes[5]) + return ((bytes[0]<<40) + (bytes[1]<<32) + (bytes[2]<<24) + + (bytes[3]<<16) + (bytes[4]<<8) + bytes[5]) # Thanks to Thomas Heller for ctypes and for his help with its use here. @@ -464,7 +466,7 @@ def _windll_getnode(): def _random_getnode(): """Get a random node ID, with eighth bit set as suggested by RFC 4122.""" import random - return random.randrange(0, 1<<48L) | 0x010000000000L + return random.randrange(0, 1<<48) | 0x010000000000 _node = None @@ -514,18 +516,18 @@ def uuid1(node=None, clock_seq=None): nanoseconds = int(time.time() * 1e9) # 0x01b21dd213814000 is the number of 100-ns intervals between the # UUID epoch 1582-10-15 00:00:00 and the Unix epoch 1970-01-01 00:00:00. - timestamp = int(nanoseconds/100) + 0x01b21dd213814000L + timestamp = int(nanoseconds/100) + 0x01b21dd213814000 if _last_timestamp is not None and timestamp <= _last_timestamp: timestamp = _last_timestamp + 1 _last_timestamp = timestamp if clock_seq is None: import random - clock_seq = random.randrange(1<<14L) # instead of stable storage - time_low = timestamp & 0xffffffffL - time_mid = (timestamp >> 32L) & 0xffffL - time_hi_version = (timestamp >> 48L) & 0x0fffL - clock_seq_low = clock_seq & 0xffL - clock_seq_hi_variant = (clock_seq >> 8L) & 0x3fL + clock_seq = random.randrange(1<<14) # instead of stable storage + time_low = timestamp & 0xffffffff + time_mid = (timestamp >> 32) & 0xffff + time_hi_version = (timestamp >> 48) & 0x0fff + clock_seq_low = clock_seq & 0xff + clock_seq_hi_variant = (clock_seq >> 8) & 0x3f if node is None: node = getnode() return UUID(fields=(time_low, time_mid, time_hi_version, diff --git a/Lib/xdrlib.py b/Lib/xdrlib.py index 23e1ff2..2f5db9b 100644 --- a/Lib/xdrlib.py +++ b/Lib/xdrlib.py @@ -61,8 +61,8 @@ class Packer: else: self.__buf.write('\0\0\0\0') def pack_uhyper(self, x): - self.pack_uint(x>>32 & 0xffffffffL) - self.pack_uint(x & 0xffffffffL) + self.pack_uint(x>>32 & 0xffffffff) + self.pack_uint(x & 0xffffffff) pack_hyper = pack_uhyper @@ -164,12 +164,12 @@ class Unpacker: def unpack_uhyper(self): hi = self.unpack_uint() lo = self.unpack_uint() - return long(hi)<<32 | lo + return int(hi)<<32 | lo def unpack_hyper(self): x = self.unpack_uhyper() - if x >= 0x8000000000000000L: - x = x - 0x10000000000000000L + if x >= 0x8000000000000000: + x = x - 0x10000000000000000 return x def unpack_float(self): diff --git a/Lib/xml/dom/NodeFilter.py b/Lib/xml/dom/NodeFilter.py index fc05245..640e0bf 100644 --- a/Lib/xml/dom/NodeFilter.py +++ b/Lib/xml/dom/NodeFilter.py @@ -9,7 +9,7 @@ class NodeFilter: FILTER_REJECT = 2 FILTER_SKIP = 3 - SHOW_ALL = 0xFFFFFFFFL + SHOW_ALL = 0xFFFFFFFF SHOW_ELEMENT = 0x00000001 SHOW_ATTRIBUTE = 0x00000002 SHOW_TEXT = 0x00000004 diff --git a/Lib/xmlrpclib.py b/Lib/xmlrpclib.py index f584ad7..16e2b3b 100644 --- a/Lib/xmlrpclib.py +++ b/Lib/xmlrpclib.py @@ -183,8 +183,8 @@ else: __version__ = "1.0.1" # xmlrpc integer limits -MAXINT = 2L**31-1 -MININT = -2L**31 +MAXINT = 2**31-1 +MININT = -2**31 # -------------------------------------------------------------------- # Error constants (from Dan Libby's specification at diff --git a/Lib/zipfile.py b/Lib/zipfile.py index 0f3bccc..cae04f4 100644 --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -280,15 +280,15 @@ class ZipInfo (object): idx = 0 # ZIP64 extension (large files and/or large archives) - if self.file_size == -1 or self.file_size == 0xFFFFFFFFL: + if self.file_size == -1 or self.file_size == 0xFFFFFFFF: self.file_size = counts[idx] idx += 1 - if self.compress_size == -1 or self.compress_size == 0xFFFFFFFFL: + if self.compress_size == -1 or self.compress_size == 0xFFFFFFFF: self.compress_size = counts[idx] idx += 1 - if self.header_offset == -1 or self.header_offset == 0xffffffffL: + if self.header_offset == -1 or self.header_offset == 0xffffffff: old = self.header_offset self.header_offset = counts[idx] idx+=1 @@ -548,7 +548,7 @@ class ZipFile: while arcname[0] in (os.sep, os.altsep): arcname = arcname[1:] zinfo = ZipInfo(arcname, date_time) - zinfo.external_attr = (st[0] & 0xFFFF) << 16L # Unix attributes + zinfo.external_attr = (st[0] & 0xFFFF) << 16 # Unix attributes if compress_type is None: zinfo.compress_type = self.compression else: diff --git a/Parser/tokenizer.c b/Parser/tokenizer.c index 4c3c29e..84b7232 100644 --- a/Parser/tokenizer.c +++ b/Parser/tokenizer.c @@ -1323,17 +1323,13 @@ tok_get(register struct tok_state *tok, char **p_start, char **p_end) return ERRORTOKEN; } } - if (c == 'l' || c == 'L') - c = tok_nextc(tok); } else { /* Decimal */ do { c = tok_nextc(tok); } while (isdigit(c)); - if (c == 'l' || c == 'L') - c = tok_nextc(tok); - else { + { /* Accept floating point numbers. */ if (c == '.') { fraction: diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 93e6058..7e699b2 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2126,7 +2126,6 @@ _PyBuiltin_Init(void) SETBUILTIN("property", &PyProperty_Type); SETBUILTIN("int", &PyLong_Type); SETBUILTIN("list", &PyList_Type); - SETBUILTIN("long", &PyLong_Type); SETBUILTIN("object", &PyBaseObject_Type); SETBUILTIN("reversed", &PyReversed_Type); SETBUILTIN("set", &PySet_Type); |