Skip to content

Commit

Permalink
Garbage Collection - 1:38:37
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kashani committed Jul 9, 2018
1 parent 76a30c0 commit f3b0d9a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Object-Oriented-Programming/MohammadrezaKasaieSharifi.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,13 @@ def thisFunctionName(self, name):
# __bases__
print("Person.__bases__:", Person.__bases__)

# __ Garbage Collection ==> Happening by python. --> we can define a method name Distructor. It can show you a message when the object is removing.

# a = 1
# b = a
# id(a)
# id(b) # Same as a. Now we have two different variables which are pointing to the same amount.
# del(a)
# We do not have the arrow from a to 1 any more.
# If I say del(b) there is no a and b.
# Now python will figure out that we have an object with no use!

0 comments on commit f3b0d9a

Please sign in to comment.