You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python3 uses del for uninitialization of classes, it would be good to have this as well, it can help to uninitialize python variables, while in dealloc we can uninitialize c variables.
this is useful for example when we are using a module that uses ctypes, or is dependent on some python initialization.
The text was updated successfully, but these errors were encountered:
Right, PEP 442 allows this. Cython currently implements it the other way round and calls tp_finalize() from tp_dealloc(), but it would certainly be nice to also support __del__ directly. PR welcome.
How to do it:
The tp_finalize slot in TypeSlots.py needs to become a MethodSlot backed by __del__.
This seems worth a dedicated set of tests, maybe tests/run/pep442_tp_finalize.pyx.
python3 uses del for uninitialization of classes, it would be good to have this as well, it can help to uninitialize python variables, while in dealloc we can uninitialize c variables.
this is useful for example when we are using a module that uses ctypes, or is dependent on some python initialization.
The text was updated successfully, but these errors were encountered: