Re: [Numpy-discussion] Integers to integer powers

2016-06-04 Thread Charles R Harris
On Tue, May 24, 2016 at 2:33 PM, R Schumacher wrote: > At 01:15 PM 5/24/2016, you wrote: > > On 5/24/2016 3:57 PM, Eric Moore wrote: > > Changing np.arange(10)**3 to have a non-integer dtype seems like a big > change. > > > > What about np.arange(100)**5? > > > Interesting, one warning per instan

[Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread Charles R Harris
Hi All, I've made a new post so that we can make an explicit decision. AFAICT, the two proposals are 1. Integers to negative integer powers raise an error. 2. Integers to integer powers always results in floats. My own sense is that 1. would be closest to current behavior and using a floa

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread Nathaniel Smith
+1 On Sat, Jun 4, 2016 at 10:22 AM, Charles R Harris wrote: > Hi All, > > I've made a new post so that we can make an explicit decision. AFAICT, the > two proposals are > > Integers to negative integer powers raise an error. > Integers to integer powers always results in floats. > > My own sense

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread Matthew Brett
On Sat, Jun 4, 2016 at 10:45 AM, Nathaniel Smith wrote: > +1 > > On Sat, Jun 4, 2016 at 10:22 AM, Charles R Harris > wrote: >> Hi All, >> >> I've made a new post so that we can make an explicit decision. AFAICT, the >> two proposals are >> >> Integers to negative integer powers raise an error. >>

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread Charles R Harris
On Sat, Jun 4, 2016 at 11:22 AM, Charles R Harris wrote: > Hi All, > > I've made a new post so that we can make an explicit decision. AFAICT, the > two proposals are > > >1. Integers to negative integer powers raise an error. >2. Integers to integer powers always results in floats. > > My

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread josef . pktd
On Sat, Jun 4, 2016 at 3:43 PM, Charles R Harris wrote: > > > On Sat, Jun 4, 2016 at 11:22 AM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> Hi All, >> >> I've made a new post so that we can make an explicit decision. AFAICT, >> the two proposals are >> >> >>1. Integers to negat

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread Matthew Brett
On Sat, Jun 4, 2016 at 12:47 PM, wrote: > > > On Sat, Jun 4, 2016 at 3:43 PM, Charles R Harris > wrote: >> >> >> >> On Sat, Jun 4, 2016 at 11:22 AM, Charles R Harris >> wrote: >>> >>> Hi All, >>> >>> I've made a new post so that we can make an explicit decision. AFAICT, >>> the two proposals ar

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread josef . pktd
On Sat, Jun 4, 2016 at 3:49 PM, Matthew Brett wrote: > On Sat, Jun 4, 2016 at 12:47 PM, wrote: > > > > > > On Sat, Jun 4, 2016 at 3:43 PM, Charles R Harris < > charlesr.har...@gmail.com> > > wrote: > >> > >> > >> > >> On Sat, Jun 4, 2016 at 11:22 AM, Charles R Harris > >> wrote: > >>> > >>> Hi

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread Peter Creasey
> > +1 > > On Sat, Jun 4, 2016 at 10:22 AM, Charles R Harris > wrote: >> Hi All, >> >> I've made a new post so that we can make an explicit decision. AFAICT, the >> two proposals are >> >> Integers to negative integer powers raise an error. >> Integers to integer powers always results in floats. >

[Numpy-discussion] PyArray_Scalar should not use memcpy

2016-06-04 Thread Matti Picus
Hi. This is a heads up and RFC about a pull request I am preparing for PyArray_Scalar, within the framework of getting NumPy working properly on PyPy. For those who don't know, the numpy HEAD builds and runs on PyPy2.7 HEAD (otherwise known as nightly default). However there are a number of tes

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread V. Armando Sole
Also in favor of 2. Always return a float for '**' On 04.06.2016 21:47, josef.p...@gmail.com wrote: On Sat, Jun 4, 2016 at 3:43 PM, Charles R Harris wrote: On Sat, Jun 4, 2016 at 11:22 AM, Charles R Harris wrote: Hi All, I've made a new post so that we can make an explicit decision. AFAIC

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread Nathaniel Smith
On Sat, Jun 4, 2016 at 2:07 PM, V. Armando Sole wrote: > Also in favor of 2. Always return a float for '**' Even if we did want to switch to this, it's such a major backwards-incompatible change that I'm not sure how we could actually make the transition without first making it an error for a whi

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread josef . pktd
On Sat, Jun 4, 2016 at 6:10 PM, Nathaniel Smith wrote: > On Sat, Jun 4, 2016 at 2:07 PM, V. Armando Sole wrote: > > Also in favor of 2. Always return a float for '**' > > Even if we did want to switch to this, it's such a major > backwards-incompatible change that I'm not sure how we could actua

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread Charles R Harris
On Sat, Jun 4, 2016 at 5:27 PM, wrote: > > > On Sat, Jun 4, 2016 at 6:10 PM, Nathaniel Smith wrote: > >> On Sat, Jun 4, 2016 at 2:07 PM, V. Armando Sole wrote: >> > Also in favor of 2. Always return a float for '**' >> >> Even if we did want to switch to this, it's such a major >> backwards-inc

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread josef . pktd
On Sat, Jun 4, 2016 at 8:07 PM, Charles R Harris wrote: > > > On Sat, Jun 4, 2016 at 5:27 PM, wrote: > >> >> >> On Sat, Jun 4, 2016 at 6:10 PM, Nathaniel Smith wrote: >> >>> On Sat, Jun 4, 2016 at 2:07 PM, V. Armando Sole wrote: >>> > Also in favor of 2. Always return a float for '**' >>> >>>

Re: [Numpy-discussion] PyArray_Scalar should not use memcpy

2016-06-04 Thread Nathaniel Smith
On Jun 4, 2016 13:58, "Matti Picus" wrote: > > Hi. This is a heads up and RFC about a pull request I am preparing for PyArray_Scalar, within the framework of getting NumPy working properly on PyPy. For those who don't know, the numpy HEAD builds and runs on PyPy2.7 HEAD (otherwise known as nightly

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread Charles R Harris
On Sat, Jun 4, 2016 at 6:17 PM, wrote: > > > On Sat, Jun 4, 2016 at 8:07 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Sat, Jun 4, 2016 at 5:27 PM, wrote: >> >>> >>> >>> On Sat, Jun 4, 2016 at 6:10 PM, Nathaniel Smith wrote: >>> On Sat, Jun 4, 2016 at 2:07 PM, V.

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread josef . pktd
On Sat, Jun 4, 2016 at 9:16 PM, Charles R Harris wrote: > > > On Sat, Jun 4, 2016 at 6:17 PM, wrote: > >> >> >> On Sat, Jun 4, 2016 at 8:07 PM, Charles R Harris < >> charlesr.har...@gmail.com> wrote: >> >>> >>> >>> On Sat, Jun 4, 2016 at 5:27 PM, wrote: >>> On Sat, Jun 4, 2016 at

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread Charles R Harris
On Sat, Jun 4, 2016 at 7:54 PM, wrote: > > > On Sat, Jun 4, 2016 at 9:16 PM, Charles R Harris < > charlesr.har...@gmail.com> wrote: > >> >> >> On Sat, Jun 4, 2016 at 6:17 PM, wrote: >> >>> >>> >>> On Sat, Jun 4, 2016 at 8:07 PM, Charles R Harris < >>> charlesr.har...@gmail.com> wrote: >>> >

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread Nathaniel Smith
On Jun 4, 2016 7:23 PM, "Charles R Harris" wrote: > [...] > We could always try the float option and see what breaks, but I expect there is a fair amount of code using small exponents like 2 or 3 where it is expected that the result is still integer. I would like more input from users than we have

Re: [Numpy-discussion] Integers to integer powers, let's make a decision

2016-06-04 Thread Charles R Harris
On Sat, Jun 4, 2016 at 9:26 PM, Nathaniel Smith wrote: > On Jun 4, 2016 7:23 PM, "Charles R Harris" > wrote: > > > [...] > > We could always try the float option and see what breaks, but I expect > there is a fair amount of code using small exponents like 2 or 3 where it > is expected that the r