Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread Travis E. Oliphant
Charles R Harris wrote: > > I agree with all that, which is why I'm not advocating a change. But > it does raise the bar for working with the C code and I think the > current case is an example of that. > Yes it does. I also agree that reference counting is the hardest part of coding with the

Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread Charles R Harris
On Wed, May 21, 2008 at 10:55 PM, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > Charles R Harris wrote: > > > > > > On Wed, May 21, 2008 at 9:32 PM, Travis E. Oliphant > > <[EMAIL PROTECTED] > wrote: > > > > Charles R Harris wrote: > > > Really, all the incremen

Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread Travis E. Oliphant
Charles R Harris wrote: > > > On Wed, May 21, 2008 at 9:32 PM, Travis E. Oliphant > <[EMAIL PROTECTED] > wrote: > > Charles R Harris wrote: > > Really, all the increments and decrements should be inside > > PyArray_FromArray, but calls to this function are sca

Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread Charles R Harris
On Wed, May 21, 2008 at 8:56 PM, David Cournapeau < [EMAIL PROTECTED]> wrote: > Charles R Harris wrote: > > David, > > > > I'm not sure that fix is completely correct. The out keyword is funny > > and I'm not what the specs are supposed to be, but generally the > > output is cast rather than an er

Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread David Cournapeau
David Cournapeau wrote: > > Thanks for the clarification. I fixed the code accordingly, > Ok, you beat me :) cheers, David ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread David Cournapeau
Travis E. Oliphant wrote: > No, that's not right. The reference is stolen if it fails as well. > This is true of all descriptor data-types. Perhaps it is weird, but it > was a lot easier to retro-fit Numeric PyArray_Descr as a Python object > that way. > Thanks for the clarification. I

Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread Charles R Harris
On Wed, May 21, 2008 at 9:32 PM, Travis E. Oliphant <[EMAIL PROTECTED]> wrote: > Charles R Harris wrote: > > Really, all the increments and decrements should be inside > > PyArray_FromArray, but calls to this function are scattered all over. > I don't understand what you mean by this statement.

Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread Travis E. Oliphant
Charles R Harris wrote: > Really, all the increments and decrements should be inside > PyArray_FromArray, but calls to this function are scattered all over. I don't understand what you mean by this statement.All functions that return an object and take a PyArray_Descr object steal a reference

Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread Charles R Harris
On Wed, May 21, 2008 at 9:03 PM, David Cournapeau < [EMAIL PROTECTED]> wrote: > Charles R Harris wrote: > > > > > > And I'm not sure self->desc needs its reference count decremented, > > PyArray_FromArray is one of those vicious, nasty functions with side > > effects and might decrement the count

Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread Travis E. Oliphant
David Cournapeau wrote: > Charles R Harris wrote: > >> And I'm not sure self->desc needs its reference count decremented, >> PyArray_FromArray is one of those vicious, nasty functions with side >> effects and might decrement the count itself. >> > > might ? What do you mean by might decre

Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread David Cournapeau
Charles R Harris wrote: > > > And I'm not sure self->desc needs its reference count decremented, > PyArray_FromArray is one of those vicious, nasty functions with side > effects and might decrement the count itself. might ? What do you mean by might decrement ? If the call to PyAarray_FromArray

Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread David Cournapeau
Charles R Harris wrote: > David, > > I'm not sure that fix is completely correct. The out keyword is funny > and I'm not what the specs are supposed to be, but generally the > output is cast rather than an error raised. I think the out argument is one of this thing which is rather a mess right

Re: [Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread Charles R Harris
On Wed, May 21, 2008 at 8:48 PM, Charles R Harris <[EMAIL PROTECTED]> wrote: > David, > > I'm not sure that fix is completely correct. The out keyword is funny and > I'm not what the specs are supposed to be, but generally the output is cast > rather than an error raised. We need an official spec

[Numpy-discussion] Fix to #789 maybe not right.

2008-05-21 Thread Charles R Harris
David, I'm not sure that fix is completely correct. The out keyword is funny and I'm not what the specs are supposed to be, but generally the output is cast rather than an error raised. We need an official spec here because the documentation of this feature is essentially random. Note that the sha