In Java, using the close() method frees resources by removing out of scope objects. I am confused as to what is the Python equivalent for this?
- Does Python's garbage collector automatically do this?
- Is it the
delmethod? - Should I use the
withstatement?
Any help will be appreciated.
Edit: My goal is to explicitly remove class objects when desired, not file objects.