referans sayacı örneği 2

This commit is contained in:
Mert Gör 🇹🇷 2023-07-15 15:14:43 +03:00
parent 27ec2999c4
commit f24438f86d
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9

View File

@ -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