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

Function unctrl

Lib/curses/ascii.py:89–99  ·  view source on GitHub ↗
(c)

Source from the content-addressed store, hash-verified

87 return _ctoi(c) | 0x80
88
89def unctrl(c):
90 bits = _ctoi(c)
91 if bits == 0x7f:
92 rep = "^?"
93 elif isprint(bits & 0x7f):
94 rep = chr(bits & 0x7f)
95 else:
96 rep = "^" + chr(((bits & 0x7f) | 0x20) + 0x20)
97 if bits & 0x80:
98 return "!" + rep
99 return rep

Callers 1

test_unctrlMethod · 0.85

Calls 2

_ctoiFunction · 0.85
isprintFunction · 0.85

Tested by 1

test_unctrlMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…