> Possible solutions include > 1. using `weakref.finalize()` (as you also suggested) > 2. cythonize everything, make all classes `cdef`'d, and switch from `__del__` to `__dealloc__` > 3. using a lightweight shutdown detection hack (see, e.g., https://github.com/numba/numba/issues/9731#issuecomment-2383856159 and https://github.com/numba/llvmlite/commit/7347d77e5a5494a96fe188108c52ceb8fe39f02c) _Originally posted by @leofang in https://github.com/NVIDIA/cuda-python/pull/87#discussion_r1792740313_
Originally posted by @leofang in #87 (comment)