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

Method expand_default

Lib/optparse.py:273–281  ·  view source on GitHub ↗
(self, option)

Source from the content-addressed store, hash-verified

271
272
273 def expand_default(self, option):
274 if self.parser is None or not self.default_tag:
275 return option.help
276
277 default_value = self.parser.defaults.get(option.dest)
278 if default_value is NO_DEFAULT or default_value is None:
279 default_value = self.NO_DEFAULT_VALUE
280
281 return option.help.replace(self.default_tag, str(default_value))
282
283 def format_option(self, option):
284 # The help for each option consists of two parts:

Callers 1

format_optionMethod · 0.95

Calls 3

strFunction · 0.85
getMethod · 0.45
replaceMethod · 0.45

Tested by

no test coverage detected