From 8f5a9e8908be7193a6c01ecfa0be4226c28759cb Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Sun, 28 Apr 2024 20:19:08 +0800 Subject: [PATCH] Update 07_dict.py --- tests/07_dict.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/07_dict.py b/tests/07_dict.py index f6febf93..1ab6da6c 100644 --- a/tests/07_dict.py +++ b/tests/07_dict.py @@ -162,3 +162,11 @@ except TypeError: a = {1: 2, 3: 4} a['a'] = a assert repr(a) == "{1: 2, 3: 4, 'a': {...}}" + +# test gc +import gc +gc.collect() +x = gc.collect() +for k, v in a.items(): + pass +assert x+1 == gc.collect()