MCPcopy Index your code
hub / github.com/RustPython/RustPython / _shorten

Function _shorten

Lib/unittest/util.py:18–22  ·  view source on GitHub ↗
(s, prefixlen, suffixlen)

Source from the content-addressed store, hash-verified

16assert _MIN_DIFF_LEN >= 0
17
18def _shorten(s, prefixlen, suffixlen):
19 skip = len(s) - prefixlen - suffixlen
20 if skip > _PLACEHOLDER_LEN:
21 s = '%s[%d chars]%s' % (s[:prefixlen], skip, s[len(s) - suffixlen:])
22 return s
23
24def _common_shorten_repr(*args):
25 args = tuple(map(safe_repr, args))

Callers 1

_common_shorten_reprFunction · 0.85

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected