diff --git a/special-method-names.html b/special-method-names.html index b2714dd..e497e42 100644 --- a/special-method-names.html +++ b/special-method-names.html @@ -777,7 +777,7 @@ def __exit__(self, *args):
x = MyClass()
x.__new__()
-del x
x.__del__()
@@ -815,6 +815,8 @@ def __exit__(self, *args):
MyABC.__subclasshook__(C)
+* Exactly when Python calls the __del__() special method is incredibly complicated. To fully understand it, you need to know how Python keeps track of objects in memory. Here’s a good article on Python garbage collection and how it relates to class destructor methods. You should also read about weak references, the weakref module, and probably the gc module for good measure.
+
Modules mentioned in this appendix: