[python] How do I correctly clean up a Python object?