From c41f2a4db43af0eb7a9a910e12235a5c638822ce Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Fri, 17 May 2013 23:30:10 +0200 Subject: [PATCH] Mention the new bit in the GC header --- pep-0442.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pep-0442.txt b/pep-0442.txt index fbb023dd1..e37f24d4e 100644 --- a/pep-0442.txt +++ b/pep-0442.txt @@ -82,7 +82,7 @@ Impact While this PEP discusses CPython-specific implementation details, the change in finalization semantics is expected to affect the Python ecosystem as a whole. In particular, this PEP obsoletes the current -guideline that "objects with a __del__ method should not be part of a +guideline that "objects with a ``__del__`` method should not be part of a reference cycle". @@ -170,6 +170,11 @@ they are not finalized and end up in ``gc.garbage``. However, a non-NULL ``tp_del`` is not encountered anymore in the CPython source tree (except for testing purposes). +On the internal side, a bit is reserved in the GC header for GC-managed +objects to signal that they were finalized. This helps avoid finalizing +an object twice (and, especially, finalizing a CT object after it was broken +by the GC). + Discussion ==========