@@ -111,7 +111,7 @@ See :ref:`__slots__ documentation <slots>` for details.
111
111
112
112
Exceptions raised by the callback will be noted on the standard error output,
113
113
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.
115
115
116
116
Weak references are :term: `hashable ` if the *object * is hashable. They will
117
117
maintain their hash value even after the *object * was deleted. If
@@ -221,8 +221,7 @@ than needed.
221
221
Added support for ``| `` and ``|= `` operators, as specified in :pep: `584 `.
222
222
223
223
: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.
226
225
227
226
228
227
.. method :: WeakValueDictionary.valuerefs()
@@ -281,7 +280,7 @@ objects.
281
280
Exceptions raised by finalizer callbacks during garbage collection
282
281
will be shown on the standard error output, but cannot be
283
282
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
285
284
callback.
286
285
287
286
When the program exits, each remaining live finalizer is called
@@ -523,18 +522,18 @@ is still alive. For instance
523
522
obj dead or exiting
524
523
525
524
526
- Comparing finalizers with :meth: `__del__ ` methods
527
- -------------------------------------------------
525
+ Comparing finalizers with :meth: `~object. __del__ ` methods
526
+ ---------------------------------------------------------
528
527
529
528
Suppose we want to create a class whose instances represent temporary
530
529
directories. The directories should be deleted with their contents
531
530
when the first of the following events occurs:
532
531
533
532
* 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
535
534
* the program exits.
536
535
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
538
537
follows::
539
538
540
539
class TempDir:
@@ -553,12 +552,12 @@ follows::
553
552
def __del__(self):
554
553
self.remove()
555
554
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
557
556
reference cycles from being garbage collected, and module globals are
558
557
no longer forced to :const: `None ` during :term: `interpreter shutdown `.
559
558
So this code should work without any issues on CPython.
560
559
561
- However, handling of :meth: `__del__ ` methods is notoriously implementation
560
+ However, handling of :meth: `~object. __del__ ` methods is notoriously implementation
562
561
specific, since it depends on internal details of the interpreter's garbage
563
562
collector implementation.
564
563
0 commit comments