Dec-27-2017, 01:10 AM
That's fine. Python uses "reference counting" to keep track of objects. The list has a reference to the newly created class so its memory has not been cleaned up(aka "garbage collected") even after returning from the function.