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

Method repr_string

Lib/pydoc.py:1253–1260  ·  view source on GitHub ↗
(self, x, level)

Source from the content-addressed store, hash-verified

1251 return cram(stripid(repr(x)), self.maxother)
1252
1253 def repr_string(self, x, level):
1254 test = cram(x, self.maxstring)
1255 testrepr = repr(test)
1256 if '\\' in test and '\\' not in replace(testrepr, r'\\', ''):
1257 # Backslashes are only literal in the string and are never
1258 # needed to make any special characters, so show a raw string.
1259 return 'r' + testrepr[0] + test + testrepr[0]
1260 return testrepr
1261
1262 repr_str = repr_string
1263

Callers

nothing calls this directly

Calls 3

cramFunction · 0.85
reprFunction · 0.85
replaceFunction · 0.70

Tested by

no test coverage detected