[Cython] Best way to link in Cython utility code?
Robert Bradshaw
robertwb at math.washington.edu
Sat Dec 20 19:32:30 CET 2008
On Dec 20, 2008, at 10:21 AM, Lisandro Dalcin wrote:
> Then It would be really easy to implement some ctypes hackery to make
> globally visible the API required for nanny refcounting.
This won't work for the trickiest part, all the temp variables and
exceptions that need to be handled correctly. On the other hand, the
external variables can't always be refcounted automatically, because
the semantics may dictate that the refcounts increase or decrease
(e.g. inserting into a list).
> The only gotcha is that you would need to "install" this feature
> before importing Cython-generated ext modules, I mean, something
> similar to pyximport, where you have first to import andinstall() it
> for make use of their features...
>
> But a really nice thing about this approach is that you can run in
> with an unmodified Python interpreter, and there is no need to link
> extension modules with especial shared libs or other modules...
>
>
>
> On Sat, Dec 20, 2008 at 1:53 PM, Stefan Behnel
> <stefan_ml at behnel.de> wrote:
>> Hi,
>>
>> Lisandro Dalcin wrote:
>>> Dag, sorry about my complete ignorance. This refcounting nanny is
>>> supposed to be a tool for Cython developement and testing, or
>>> rather a
>>> general mechanism for Cython-generated extension modules?
>>
>> It's meant for testing the code Cython generates and making sure
>> it gets
>> ref-counting right when doing things like assigning Python objects
>> back and
>> forth between temp variables or (I assume) jumping into exception
>> handlers
>> or returning from the middle of a function.
>>
>> When Cython gets this right, there shouldn't be any need for such a
>> functionality on the user side (read: no performance impact or the
>> like).
>>
>> Stefan
>>
>> _______________________________________________
>> Cython-dev mailing list
>> Cython-dev at codespeak.net
>> http://codespeak.net/mailman/listinfo/cython-dev
>>
>
>
>
> --
> 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
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/cython-dev
More information about the Cython-dev
mailing list