3 ms·
Exactly. The language design of Python means that the addition of cleanup code is an API change. The language design of C++ means that the addition of cleanup
by MereInterest 6y ago
Exactly. The language design of Python means that the addition of cleanup code is an API change. The language design of C++ means that the addition of cleanup code is not an API change.
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- xapata 6y agoI actually appreciate that API change, as it makes my use of resources more explicit. However, you might be interested in using ``weakref.finalize`` to keep that C++ style. https://docs.python.org/3.6/library/weakref.html#comparing-finalizers-with-del-methods https://docs.python.org/3.6/library/weakref.html#comparing-f...