@@ -111,7 +111,7 @@ See :ref:`__slots__ documentation <slots>` for details.
111111
112112 Exceptions raised by the callback will be noted on the standard error output,
113113 but cannot be propagated; they are handled in exactly the same way as exceptions
114- raised from an object's :meth: `__del__ ` method.
114+ raised from an object's :meth: `~object. __del__ ` method.
115115
116116 Weak references are :term: `hashable ` if the *object * is hashable. They will
117117 maintain their hash value even after the *object * was deleted. If
@@ -221,8 +221,7 @@ than needed.
221221 Added support for ``| `` and ``|= `` operators, as specified in :pep: `584 `.
222222
223223:class: `WeakValueDictionary ` objects have an additional method that has the
224- same issues as the :meth: `keyrefs ` method of :class: `WeakKeyDictionary `
225- objects.
224+ same issues as the :meth: `WeakKeyDictionary.keyrefs ` method.
226225
227226
228227.. method :: WeakValueDictionary.valuerefs()
@@ -281,7 +280,7 @@ objects.
281280 Exceptions raised by finalizer callbacks during garbage collection
282281 will be shown on the standard error output, but cannot be
283282 propagated. They are handled in the same way as exceptions raised
284- from an object's :meth: `__del__ ` method or a weak reference's
283+ from an object's :meth: `~object. __del__ ` method or a weak reference's
285284 callback.
286285
287286 When the program exits, each remaining live finalizer is called
@@ -523,18 +522,18 @@ is still alive. For instance
523522 obj dead or exiting
524523
525524
526- Comparing finalizers with :meth: `__del__ ` methods
527- -------------------------------------------------
525+ Comparing finalizers with :meth: `~object. __del__ ` methods
526+ ---------------------------------------------------------
528527
529528Suppose we want to create a class whose instances represent temporary
530529directories. The directories should be deleted with their contents
531530when the first of the following events occurs:
532531
533532* the object is garbage collected,
534- * the object's :meth: `remove ` method is called, or
533+ * the object's :meth: `! remove ` method is called, or
535534* the program exits.
536535
537- We might try to implement the class using a :meth: `__del__ ` method as
536+ We might try to implement the class using a :meth: `~object. __del__ ` method as
538537follows::
539538
540539 class TempDir:
@@ -553,12 +552,12 @@ follows::
553552 def __del__(self):
554553 self.remove()
555554
556- Starting with Python 3.4, :meth: `__del__ ` methods no longer prevent
555+ Starting with Python 3.4, :meth: `~object. __del__ ` methods no longer prevent
557556reference cycles from being garbage collected, and module globals are
558557no longer forced to :const: `None ` during :term: `interpreter shutdown `.
559558So this code should work without any issues on CPython.
560559
561- However, handling of :meth: `__del__ ` methods is notoriously implementation
560+ However, handling of :meth: `~object. __del__ ` methods is notoriously implementation
562561specific, since it depends on internal details of the interpreter's garbage
563562collector implementation.
564563
0 commit comments