MCPcopy Index your code
hub / github.com/RustPython/RustPython / quote

Function quote

Lib/quopri.py:34–38  ·  view source on GitHub ↗

Quote a single character.

(c)

Source from the content-addressed store, hash-verified

32 return c == ESCAPE or not (b' ' <= c <= b'~')
33
34def quote(c):
35 """Quote a single character."""
36 assert isinstance(c, bytes) and len(c)==1
37 c = ord(c)
38 return ESCAPE + bytes((HEX[c//16], HEX[c%16]))
39
40
41

Callers 2

writeFunction · 0.70
encodeFunction · 0.70

Calls 3

isinstanceFunction · 0.85
lenFunction · 0.85
ordFunction · 0.85

Tested by

no test coverage detected