On Mon, Dec 14, 2015 at 3:56 PM, Benjamin Root <ben.v.root@gmail.com> wrote:
> By the way, any reason why this works?
> >>> np.array(xrange(10))
> array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
It's not a generator. It's a true sequence that just happens to have a special implementation rather than being a generic container.
>>> len(xrange(10))
10
>>> xrange(10)[5]
5
--
Robert Kern