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

Method get_default_values

Lib/optparse.py:1296–1308  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1294 return options
1295
1296 def get_default_values(self):
1297 if not self.process_default_values:
1298 # Old, pre-Optik 1.5 behaviour.
1299 return Values(self.defaults)
1300
1301 defaults = self.defaults.copy()
1302 for option in self._get_all_options():
1303 default = defaults.get(option.dest)
1304 if isinstance(default, str):
1305 opt_str = option.get_opt_string()
1306 defaults[option.dest] = option.check_value(opt_str, default)
1307
1308 return Values(defaults)
1309
1310
1311 # -- OptionGroup methods -------------------------------------------

Callers 6

parse_argsMethod · 0.95
test_basic_defaultsMethod · 0.80
test_process_defaultMethod · 0.80
test_defaultsMethod · 0.80

Calls 6

_get_all_optionsMethod · 0.95
ValuesClass · 0.85
get_opt_stringMethod · 0.80
copyMethod · 0.45
getMethod · 0.45
check_valueMethod · 0.45

Tested by 5

test_basic_defaultsMethod · 0.64
test_process_defaultMethod · 0.64
test_defaultsMethod · 0.64