On 2019-01-09 22:12, Stefan Behnel wrote:
I would like to avoid adding Cython specific features that are better
served by the general finalisation mechanism of PEP-442.
That could also be used as argument against @cython.no_gc_clear but we
still have that anyway.
Second, with PEP-442 you don
Jeroen Demeyer schrieb am 09.01.19 um 15:43:
> (reviving this thread after I thought about it some more...)
>
> As I mentioned in the original post, I want something like __dealloc__ but
> with access to a particular cdef attribute (representing a Python object).
> Since Python attributes of cdef
(reviving this thread after I thought about it some more...)
As I mentioned in the original post, I want something like __dealloc__
but with access to a particular cdef attribute (representing a Python
object). Since Python attributes of cdef classes may have been cleared
by tp_clear, they can
Jeroen Demeyer schrieb am 07.09.2018 um 10:14:
> On 2018-09-07 06:35, Stefan Behnel wrote:
>> Maybe you actually want "tp_finalize"?
>>
>> https://www.python.org/dev/peps/pep-0442/
>>
>> Cython moves "__del__" methods there in Py3.4+.
>
> First of all, are you sure? I tried to cythonize
>
> cdef
On 2018-09-07 06:35, Stefan Behnel wrote:
Maybe you actually want "tp_finalize"?
https://www.python.org/dev/peps/pep-0442/
Cython moves "__del__" methods there in Py3.4+.
First of all, are you sure? I tried to cythonize
cdef class X:
def __del__(self):
pass
but the generated C c
Jeroen Demeyer wrote:
I have a concrete use case where I want something like __dealloc__ but
> *before* Python attributes are cleared. So this really belongs in tp_clear().
Are you sure you can't do it in __del__? From what I gather,
the presence of __del__ no longer prevents cyclic garbage
c
Jeroen Demeyer schrieb am 06.09.2018 um 22:54:
> Cython's __dealloc__ special method is meant to deal with cleaning up
> instances of cdef classes. However, this hooks tp_dealloc() and does not
> have meaningful access to Python attributes, since those might have been
> cleared by tp_clear().
>
>