Martin v. L?wis <[EMAIL PROTECTED]> wrote: > > Is it possible to have an array of 64-bit-ints using the standard Python > > array module? On my 64-bit architecture (AMD64, MSVC), both "int" and > > "long int" are 32 bit integers. To declare 64-bit ints, one needs either > > "long long int" or "size_t". However, according to the Python array > > documentation, arrays of "size_t" or "long long int" are not available. > > No, it's not possible.
You could do it with ctypes like this... from ctypes import * Array = c_int64 * 100 a = Array() for i in range(100): a[i] = 2**63 - i for i in range(100): print a[i] prints -9223372036854775808 9223372036854775807 9223372036854775806 [snip] 9223372036854775710 9223372036854775709 ctypes arrays are fixed length once created though. -- Nick Craig-Wood <[EMAIL PROTECTED]> -- http://www.craig-wood.com/nick -- http://mail.python.org/mailman/listinfo/python-list