From f24438f86d67e353feef7697040644e79a6bf75c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mert=20G=C3=B6r?= Date: Sat, 15 Jul 2023 15:14:43 +0300 Subject: [PATCH] =?UTF-8?q?referans=20sayac=C4=B1=20=C3=B6rne=C4=9Fi=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python-temel/referans.sayaci.2.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 python-temel/referans.sayaci.2.py diff --git a/python-temel/referans.sayaci.2.py b/python-temel/referans.sayaci.2.py new file mode 100644 index 0000000..acc85bb --- /dev/null +++ b/python-temel/referans.sayaci.2.py @@ -0,0 +1,17 @@ +import sys + +class Sample: + def __del__(self): + print('__del__ called') + +a = Sample() +print(sys.getrefcount(a)) +b = a +print(sys.getrefcount(a)) +c = b +print(sys.getrefcount(a)) +c = None +print(sys.getrefcount(a)) +b = None +print(sys.getrefcount(a)) +a = None