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

Function _shorten

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

Source from the content-addressed store, hash-verified

15assert _MIN_DIFF_LEN >= 0
16
17def _shorten(s, prefixlen, suffixlen):
18 skip = len(s) - prefixlen - suffixlen
19 if skip > _PLACEHOLDER_LEN:
20 s = '%s[%d chars]%s' % (s[:prefixlen], skip, s[len(s) - suffixlen:])
21 return s
22
23def _common_prefix(m):
24 if not m:

Callers 1

_common_shorten_reprFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…