BTW, Python does have the `__del__` special method. It's just that almost all usage of it would be better implemented via context manager.
Particularly note "finalize provides a straight forward way to register a cleanup function to be called when an object is garbage collected"
The limitation that I still run into is when a class needs to have some cleanup code added to it. In C++, you just add a destructor. In Python, you are forced to choose between non-deterministic release of resources through __del__, or changing the interface by requiring users to use a "with" block. Neither of those is a particularly satisfying option.
If you really want to keep the same interface, add a layer of abstraction. The current interface becomes a wrapper around the underlying context manager.
https://docs.python.org/3.6/library/weakref.html#comparing-f...