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

Method repr_str

Lib/reprlib.py:174–181  ·  view source on GitHub ↗
(self, x, level)

Source from the content-addressed store, hash-verified

172 return '{%s}' % (s,)
173
174 def repr_str(self, x, level):
175 s = builtins.repr(x[:self.maxstring])
176 if len(s) > self.maxstring:
177 i = max(0, (self.maxstring-3)//2)
178 j = max(0, self.maxstring-3-i)
179 s = builtins.repr(x[:i] + x[len(x)-j:])
180 s = s[:i] + self.fillvalue + s[len(s)-j:]
181 return s
182
183 def repr_int(self, x, level):
184 try:

Callers

nothing calls this directly

Calls 1

reprMethod · 0.45

Tested by

no test coverage detected