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

Method _metavar_formatter

Lib/argparse.py:639–652  ·  view source on GitHub ↗
(self, action, default_metavar)

Source from the content-addressed store, hash-verified

637 return ', '.join(option_strings) + ' ' + args_string
638
639 def _metavar_formatter(self, action, default_metavar):
640 if action.metavar is not None:
641 result = action.metavar
642 elif action.choices is not None:
643 result = '{%s}' % ','.join(map(str, action.choices))
644 else:
645 result = default_metavar
646
647 def format(tuple_size):
648 if isinstance(result, tuple):
649 return result
650 else:
651 return (result, ) * tuple_size
652 return format
653
654 def _format_args(self, action, default_metavar):
655 get_metavar = self._metavar_formatter(action, default_metavar)

Callers 2

_format_argsMethod · 0.95

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected