MCPcopy Index your code
hub / github.com/python/cpython / destroy

Method destroy

Lib/optparse.py:1202–1214  ·  view source on GitHub ↗

Declare that you are done with this OptionParser. This cleans up reference cycles so the OptionParser (and all objects referenced by it) can be garbage-collected promptly. After calling destroy(), the OptionParser is unusable.

(self)

Source from the content-addressed store, hash-verified

1200
1201
1202 def destroy(self):
1203 """
1204 Declare that you are done with this OptionParser. This cleans up
1205 reference cycles so the OptionParser (and all objects referenced by
1206 it) can be garbage-collected promptly. After calling destroy(), the
1207 OptionParser is unusable.
1208 """
1209 OptionContainer.destroy(self)
1210 for group in self.option_groups:
1211 group.destroy()
1212 del self.option_list
1213 del self.option_groups
1214 del self.formatter
1215
1216
1217 # -- Private methods -----------------------------------------------

Callers 1

test_refleakMethod · 0.95

Calls 1

destroyMethod · 0.45

Tested by 1

test_refleakMethod · 0.76