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

Function escape_ascii

Tools/i18n/pygettext.py:206–209  ·  view source on GitHub ↗
(s, encoding)

Source from the content-addressed store, hash-verified

204
205
206def escape_ascii(s, encoding):
207 return ''.join(escapes[ord(c)] if ord(c) < 128 else c
208 if c.isprintable() else escape_nonascii(c, encoding)
209 for c in s)
210
211
212def escape_nonascii(s, encoding):

Callers

nothing calls this directly

Calls 3

escape_nonasciiFunction · 0.85
isprintableMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…