This doesn't work in Python 2 -- range() will attempt to allocate an array with maxsize elements, which raises a MemoryError.