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

Method remove_option

Lib/optparse.py:1029–1040  ·  view source on GitHub ↗
(self, opt_str)

Source from the content-addressed store, hash-verified

1027 opt_str in self._long_opt)
1028
1029 def remove_option(self, opt_str):
1030 option = self._short_opt.get(opt_str)
1031 if option is None:
1032 option = self._long_opt.get(opt_str)
1033 if option is None:
1034 raise ValueError("no such option %r" % opt_str)
1035
1036 for opt in option._short_opts:
1037 del self._short_opt[opt]
1038 for opt in option._long_opts:
1039 del self._long_opt[opt]
1040 option.container.option_list.remove(option)
1041
1042
1043 # -- Help-formatting methods ---------------------------------------

Callers 9

basic_testMethod · 0.45
test_case_sensitivityMethod · 0.45
test_remove_optionMethod · 0.45
test_remove_short_optMethod · 0.45
test_remove_long_optMethod · 0.45
test_custom_prognameMethod · 0.45
test_callback_helpMethod · 0.45
RemoveOptionMethod · 0.45

Calls 2

getMethod · 0.45
removeMethod · 0.45

Tested by 8

basic_testMethod · 0.36
test_case_sensitivityMethod · 0.36
test_remove_optionMethod · 0.36
test_remove_short_optMethod · 0.36
test_remove_long_optMethod · 0.36
test_custom_prognameMethod · 0.36
test_callback_helpMethod · 0.36