[Numpy-discussion] Creating PyArrayObject in C++

Kenny Abernathy kenny.abernathy@gmail....
Wed Jul 8 13:20:08 CDT 2009


Thanks, you two.  That helps alot.  The PyCObject_FromVoidPtr() trick is
good to know--I still have to have my class because it holds other data, but
this definitely points me in the right direction.

On Tue, Jul 7, 2009 at 9:55 PM, Lisandro Dalcin <dalcinl@gmail.com> wrote:

> 2009/7/7 Stéfan van der Walt <stefan@sun.ac.za>:
> > Hi Kenny
> >
> > 2009/7/7 Kenny Abernathy <kenny.abernathy@gmail.com>:
> >> I can guarantee that all analysis will be finished before the Unit
> object is
> >> destroyed and delete[] is called, so I don't think that's a problem.
> >
> > There is a neat trick to make sure things don't get deallocated out of
> order:
> >
> > http://blog.enthought.com/?p=62
> >
>
> Moreover, if you use PyCObject_FromVoidPtr()
> http://docs.python.org/c-api/cobject.html, you can register a
> deallocation routine to be called at DECREF time, so no need at all of
> implementing your a brand new type.
>
>
>
> --
> Lisandro Dalcín
> ---------------
> Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
> Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
> Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
> PTLC - Güemes 3450, (3000) Santa Fe, Argentina
> Tel/Fax: +54-(0)342-451.1594
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090708/d6c804f8/attachment.html 


More information about the NumPy-Discussion mailing list