Add decorator @gc_no_clear to disable tp_clear slot.
authorTorsten Landschoff <torsten.landschoff@dynamore.de>
Thu, 1 Aug 2013 22:45:15 +0000 (00:45 +0200)
committerTorsten Landschoff <torsten.landschoff@dynamore.de>
Thu, 1 Aug 2013 22:50:37 +0000 (00:50 +0200)
commit73ba98cc7d5eb2561a8b3b92efb64924b0bebc94
tree2ae6e623adf37432412a238324faa28ca69910fb
parentefbff33790a9fbfe6aa83491c18091018744d750
Add decorator @gc_no_clear to disable tp_clear slot.

This can be useful if some external objects have to be cleaned up when
the Python object dies. Otherwise the cyclic garbage collector may
drop the references before the cleanup has any chance to run.

Includes documentation and a simple unit test.

Discussion: http://article.gmane.org/gmane.comp.python.cython.devel/14986
Cython/Compiler/ModuleNode.py
Cython/Compiler/Options.py
Cython/Compiler/Symtab.py
Cython/Compiler/TypeSlots.py
docs/src/userguide/extension_types.rst
tests/run/gc_no_clear.pyx [new file with mode: 0644]