25/11/2023 4:35 pm
Topic starter
Notifications
Clear all
Why destructors in python is not much needed as in C++?
0
Why destructors in python is not much needed as in C++?
Answer
Add a comment
Add a comment
1 Answer
0
01/12/2023 7:12 am
In Python, destructors are not needed as much as in C++ because Python has a garbage collector that handles memory management automatically. The __del__() method is a known as a destructor method in Python. It is called when all references to the object have been deleted i.e when an object is garbage collected.
Add a comment
Add a comment
Forum Information
- 14 Forums
- 1,836 Topics
- 5,052 Posts
- 0 Online
- 1,078 Members
Our newest member: Richardnop
Latest Post: loli
Forum Icons:
Forum contains no unread posts
Forum contains unread posts
Topic Icons:
Not Replied
Replied
Active
Hot
Sticky
Unapproved
Solved
Private
Closed