3 ms·
Is there a good way to add __del__() methods or to wrap Context Manager __enter__()/__exit__() methods around objects that never needed them because of the gc?
by westurner 1y ago
Is there a good way to add __del__() methods or to wrap Context Manager __enter__()/__exit__() methods around objects that never needed them because of the gc?
Hadn't seen this:
import gc
gc.disable()
Cython has __dealloc__() instead of __del__()?
- westurner 1y agoAlso, there's a recent proposal to add explicit resource management to JS: "JavaScript's New Superpower: Explicit Resource Management" https://news.ycombinator.com/item?id=44012227 https://news.ycombinator.com/item?id=44012227