On Thu, Apr 17, 2014 at 9:28 AM, Nathaniel Smith
<njs@pobox.com> wrote:
>FWIW, numpy arrays do indeed have to be of uniform type, but one of
>the supported uniform types is "arbitrary Python object".
I did not know that! However, now that I do:
% python3 ListView.py
A bunch of slices from list: 3.76 seconds
A bunch of slices from DummyListView: 3.33 seconds
A bunch of slices from ListView: 0.03 seconds
A bunch of slices from numpy.array: 0.30 seconds
The only things I changed are to add 'import numpy' at the top, and add 'np.array' to the loop of containers to try out (I also bumped up the iterations of the two loops from 8/3 times to 10/5 times just to make things take a little longer and get slightly more accurate timing I hope).