From 95d0dc8688b255a32ac21fe742020cc2c304d75a Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 10 Aug 2025 21:58:13 +0200 Subject: [PATCH] Add console output for Listing 15-29 in chapter 15 --- src/ch15-06-reference-cycles.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ch15-06-reference-cycles.md b/src/ch15-06-reference-cycles.md index 5402e16bc5..1df55a3fb7 100644 --- a/src/ch15-06-reference-cycles.md +++ b/src/ch15-06-reference-cycles.md @@ -268,6 +268,16 @@ in Listing 15-29. +Then we will see the output: + +```console +leaf strong = 1, weak = 0 +branch strong = 1, weak = 1 +leaf strong = 2, weak = 0 +leaf parent = None +leaf strong = 1, weak = 0 +``` + After `leaf` is created, its `Rc` has a strong count of 1 and a weak count of 0. In the inner scope, we create `branch` and associate it with `leaf`, at which point when we print the counts, the `Rc` in `branch`