del method example
This commit is contained in:
parent
f24438f86d
commit
aad6127d7e
1 changed files with 13 additions and 0 deletions
13
python-temel/del.method.py
Normal file
13
python-temel/del.method.py
Normal file
|
@ -0,0 +1,13 @@
|
|||
class Sample:
|
||||
def __del__(self):
|
||||
print('Nesne yok edilecek!')
|
||||
|
||||
s = Sample()
|
||||
print('Referans sayacı 1')
|
||||
k = s
|
||||
print('Referans sayacı 2')
|
||||
|
||||
k = None
|
||||
print('Referans sayacı 1')
|
||||
s = None
|
||||
print('Referans sayacı 0')
|
Loading…
Reference in a new issue