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

Method repr_string

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

Source from the content-addressed store, hash-verified

1206 return cram(stripid(repr(x)), self.maxother)
1207
1208 def repr_string(self, x, level):
1209 test = cram(x, self.maxstring)
1210 testrepr = repr(test)
1211 if '\\' in test and '\\' not in replace(testrepr, r'\\', ''):
1212 # Backslashes are only literal in the string and are never
1213 # needed to make any special characters, so show a raw string.
1214 return 'r' + testrepr[0] + test + testrepr[0]
1215 return testrepr
1216
1217 repr_str = repr_string
1218

Callers

nothing calls this directly

Calls 2

cramFunction · 0.85
replaceFunction · 0.70

Tested by

no test coverage detected