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

Method __repr__

Lib/argparse.py:117–130  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

115 """
116
117 def __repr__(self):
118 type_name = type(self).__name__
119 arg_strings = []
120 star_args = {}
121 for arg in self._get_args():
122 arg_strings.append(repr(arg))
123 for name, value in self._get_kwargs():
124 if name.isidentifier():
125 arg_strings.append('%s=%r' % (name, value))
126 else:
127 star_args[name] = value
128 if star_args:
129 arg_strings.append('**%s' % repr(star_args))
130 return '%s(%s)' % (type_name, ', '.join(arg_strings))
131
132 def _get_kwargs(self):
133 return list(self.__dict__.items())

Callers

nothing calls this directly

Calls 5

_get_argsMethod · 0.95
_get_kwargsMethod · 0.95
isidentifierMethod · 0.80
appendMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected