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

Function _common_prefix

Lib/unittest/util.py:23–31  ·  view source on GitHub ↗
(m)

Source from the content-addressed store, hash-verified

21 return s
22
23def _common_prefix(m):
24 if not m:
25 return ""
26 s1 = min(m)
27 s2 = max(m)
28 for i, c in enumerate(s1):
29 if c != s2[i]:
30 return s1[:i]
31 return s1
32
33def _common_shorten_repr(*args):
34 args = tuple(map(safe_repr, args))

Callers 1

_common_shorten_reprFunction · 0.85

Calls 1

enumerateFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…