MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / repr_str

Method repr_str

tools/python-3.11.9-amd64/Lib/reprlib.py:126–133  ·  view source on GitHub ↗
(self, x, level)

Source from the content-addressed store, hash-verified

124 return '{%s}' % (s,)
125
126 def repr_str(self, x, level):
127 s = builtins.repr(x[:self.maxstring])
128 if len(s) > self.maxstring:
129 i = max(0, (self.maxstring-3)//2)
130 j = max(0, self.maxstring-3-i)
131 s = builtins.repr(x[:i] + x[len(x)-j:])
132 s = s[:i] + self.fillvalue + s[len(s)-j:]
133 return s
134
135 def repr_int(self, x, level):
136 s = builtins.repr(x) # XXX Hope this isn't too slow...

Callers

nothing calls this directly

Calls 2

maxFunction · 0.85
reprMethod · 0.45

Tested by

no test coverage detected