Re: [Numpy-discussion] ndrange, like range but multidimensiontal

2018-10-10 Thread Allan Haldane
On 10/10/18 12:34 AM, Eric Wieser wrote: > One thing that worries me here - in python, |range(...)| in essence > generates a lazy |list| - so I’d expect |ndrange| to generate a lazy > |ndarray|. In practice, that means it would be a duck-type defining an > |__array__| method to evaluate it, and onl

Re: [Numpy-discussion] ndrange, like range but multidimensiontal

2018-10-10 Thread Stephan Hoyer
On Tue, Oct 9, 2018 at 9:34 PM Eric Wieser wrote: > One thing that worries me here - in python, range(...) in essence > generates a lazy list - so I’d expect ndrange to generate a lazy ndarray. > In practice, that means it would be a duck-type defining an __array__ > method to evaluate it, and on

Re: [Numpy-discussion] ndrange, like range but multidimensiontal

2018-10-10 Thread Mark Harfouche
Eric, Great point. The multi-dimensional slicing and sequence return type is definitely strange. I was thinking about that last night. I’m a little new to the __array__ methods. Are you saying that the sequence behaviour would stay the same, (ie. __iter__, __revesed__, __contains__), but np.asarra