Re: [Numpy-discussion] Add guaranteed no-copy to array creation and reshape?

2019-01-09 Thread Todd
On Thu, Jan 10, 2019, 01:55 Eric Wieser Slicing is a lot more important than some keyword. And design-wise, > filling the numpy namespace with singletons for keyword to other things in > that same namespace just makes no sense to me. > > At least from the perspective of discoverability, you could

Re: [Numpy-discussion] Add guaranteed no-copy to array creation and reshape?

2019-01-09 Thread Todd
On Wed, Dec 26, 2018, 18:29 Sebastian Berg Hi all, > > In https://github.com/numpy/numpy/pull/11897 I am looking into the > addition of a `copy=np.never_copy` argument to: > * np.array > * arr.reshape/np.reshape > * arr.astype > > Which would cause an error to be raised when numpy cannot gua

Re: [Numpy-discussion] Add guaranteed no-copy to array creation and reshape?

2019-01-09 Thread Todd
On Mon, Jan 7, 2019, 14:22 Feng Yu Hi, > > Was it ever brought up the possibility of a new array class (ndrefonly, > ndview) that is strictly no copy? > > All operations on ndrefonly will return ndrefonly and if the operation > cannot be completed without making a copy, it shall throw an error. >

Re: [Numpy-discussion] Add guaranteed no-copy to array creation and reshape?

2019-01-09 Thread Eric Wieser
Slicing is a lot more important than some keyword. And design-wise, filling the numpy namespace with singletons for keyword to other things in that same namespace just makes no sense to me. At least from the perspective of discoverability, you could argue that string constants form a namespace of

Re: [Numpy-discussion] Add guaranteed no-copy to array creation and reshape?

2019-01-09 Thread Ralf Gommers
On Mon, Jan 7, 2019 at 11:30 AM Eric Wieser wrote: > > @Ralf > > np.newaxis is not relevant here - it’s a simple alias for None, is just > there for code readability, and is much more widely applicable than > np.never_copy would be. > > Is there any particular reason we chose to use None? If I we