Re: [Numpy-discussion] PATCH: arange leaks references to provided dtype

2010-06-30 Thread Travis Oliphant
On Jun 30, 2010, at 3:18 PM, Lisandro Dalcin wrote: > Sorry, no time to make a proper bug report in the tracker. > > This bug have been annoying me from about 3 years, today I finally > discovered the actual issue!!. Thanks so much.This is an excellent fix. -Travis > > The code b

Re: [Numpy-discussion] __array__struct__: about using PyCapsule instead of PyCObject for Python 2.7

2010-06-30 Thread Lisandro Dalcin
On 30 June 2010 15:08, Charles R Harris wrote: > > > On Wed, Jun 30, 2010 at 10:57 AM, Lisandro Dalcin wrote: >> >> On 30 June 2010 02:48, Charles R Harris wrote: >> > >> >> Oh! Sorry! Now I realize that! >> > > Do I detect a touch of sarcasm? > No, no sarcasm at all! I just realized that PyCOb

Re: [Numpy-discussion] __array__struct__: about using PyCapsule instead of PyCObject for Python 2.7

2010-06-30 Thread Travis Oliphant
On Jun 30, 2010, at 12:48 AM, Charles R Harris wrote: > > > On Tue, Jun 29, 2010 at 8:21 PM, Lisandro Dalcin wrote: > Do we really need this for NumPy 2? What about using the old PyCObject > for all Py 2.x versions? If this is not done, perhaps NumPy 2 on top > of Py 2.x should still accept th

[Numpy-discussion] PATCH: arange leaks references to provided dtype

2010-06-30 Thread Lisandro Dalcin
Sorry, no time to make a proper bug report in the tracker. This bug have been annoying me from about 3 years, today I finally discovered the actual issue!!. The code below shows that arange leaks references to dtype (actually, PyArray_Descr instances). import sys import numpy as np t = np.dtype

Re: [Numpy-discussion] construction of object arrays

2010-06-30 Thread Keith Goodman
On Wed, Jun 30, 2010 at 10:56 AM, Neal Becker wrote: > What are ways to construct object arrays?  I want an array of objects, each > element default constructed of a particular object type. > > Say my object is class A.  I want a multi-dimensional array, each element > constructed as A(). > > Righ

Re: [Numpy-discussion] __array__struct__: about using PyCapsule instead of PyCObject for Python 2.7

2010-06-30 Thread Charles R Harris
On Wed, Jun 30, 2010 at 10:57 AM, Lisandro Dalcin wrote: > On 30 June 2010 02:48, Charles R Harris wrote: > > > > > > On Tue, Jun 29, 2010 at 8:21 PM, Lisandro Dalcin > wrote: > >> > >> Do we really need this for NumPy 2? What about using the old PyCObject > >> for all Py 2.x versions? If this

Re: [Numpy-discussion] __array__struct__: about using PyCapsule instead of PyCObject for Python 2.7

2010-06-30 Thread Charles R Harris
On Wed, Jun 30, 2010 at 10:57 AM, Lisandro Dalcin wrote: > On 30 June 2010 02:48, Charles R Harris wrote: > > > > > > On Tue, Jun 29, 2010 at 8:21 PM, Lisandro Dalcin > wrote: > >> > >> Do we really need this for NumPy 2? What about using the old PyCObject > >> for all Py 2.x versions? If this

[Numpy-discussion] construction of object arrays

2010-06-30 Thread Neal Becker
What are ways to construct object arrays? I want an array of objects, each element default constructed of a particular object type. Say my object is class A. I want a multi-dimensional array, each element constructed as A(). Right now, I use np.empty ((a,b,c...), dtype=object) and then itera

Re: [Numpy-discussion] __array__struct__: about using PyCapsule instead of PyCObject for Python 2.7

2010-06-30 Thread Lisandro Dalcin
On 30 June 2010 02:48, Charles R Harris wrote: > > > On Tue, Jun 29, 2010 at 8:21 PM, Lisandro Dalcin wrote: >> >> Do we really need this for NumPy 2? What about using the old PyCObject >> for all Py 2.x versions? If this is not done, perhaps NumPy 2 on top >> of Py 2.x should still accept the __