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)
| 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 ----------------------------------------------- |