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

Function _wrap_bytes_repr

Lib/pprint.py:877–892  ·  view source on GitHub ↗
(object, width, allowance)

Source from the content-addressed store, hash-verified

875
876
877def _wrap_bytes_repr(object, width, allowance):
878 current = b''
879 last = len(object) // 4 * 4
880 for i in range(0, len(object), 4):
881 part = object[i: i+4]
882 candidate = current + part
883 if i == last:
884 width -= allowance
885 if len(repr(candidate)) > width:
886 if current:
887 yield repr(current)
888 current = part
889 else:
890 current = candidate
891 if current:
892 yield repr(current)

Callers 1

_pprint_bytesMethod · 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…