Hoyt Koepke
2009-04-05 19:26:15 UTC
Hello,
I'm using an extension class where I need to create a number of
instances quickly, and I'm looking at the section "Can Cython create
objects or apply operators to locally created objects as pure C code?"
on http://wiki.cython.org/FAQ. Is this information still correct?
In particular, I'm wondering about it in reference to supporting
cyclical garbage collection and creating object via PyObject_GC_New
etc. IIRC, cython automatically supports cyclical garbage collection
on classes that have python members, and my extension class falls into
this category. Should I
a) Use Py_NEW, as specified in the FAQ?
b) Replace Py_NEW with Py_Object_GC_New, and do a?
c) Ignore this and just go with standard creation and deletion,
ignoring the fact that I'll be calling the constructors through
python.
Thanks!
--Hoyt
++++++++++++++++++++++++++++++++++++++++++++++++
+ Hoyt Koepke
+ University of Washington Department of Statistics
+ http://www.stat.washington.edu/~hoytak/
+ hoytak-***@public.gmane.org
++++++++++++++++++++++++++++++++++++++++++
I'm using an extension class where I need to create a number of
instances quickly, and I'm looking at the section "Can Cython create
objects or apply operators to locally created objects as pure C code?"
on http://wiki.cython.org/FAQ. Is this information still correct?
In particular, I'm wondering about it in reference to supporting
cyclical garbage collection and creating object via PyObject_GC_New
etc. IIRC, cython automatically supports cyclical garbage collection
on classes that have python members, and my extension class falls into
this category. Should I
a) Use Py_NEW, as specified in the FAQ?
b) Replace Py_NEW with Py_Object_GC_New, and do a?
c) Ignore this and just go with standard creation and deletion,
ignoring the fact that I'll be calling the constructors through
python.
Thanks!
--Hoyt
++++++++++++++++++++++++++++++++++++++++++++++++
+ Hoyt Koepke
+ University of Washington Department of Statistics
+ http://www.stat.washington.edu/~hoytak/
+ hoytak-***@public.gmane.org
++++++++++++++++++++++++++++++++++++++++++