I\'d like to create a random list of integers for testing purposes. The distribution of the numbers is not important. The only thing that is counting is time
All the random methods end up calling random.random() so the best way is to call it directly:
[int(1000*random.random()) for i in xrange(10000)]
For example,
random.randint calls random.randrange.random.randrange has a bunch of overhead to check the range before returning istart + istep*int(self.random() * n).NumPy is much faster still of course.