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

Method repr_instance

Lib/reprlib.py:206–217  ·  view source on GitHub ↗
(self, x, level)

Source from the content-addressed store, hash-verified

204 return s
205
206 def repr_instance(self, x, level):
207 try:
208 s = builtins.repr(x)
209 # Bugs in x.__repr__() can cause arbitrary
210 # exceptions -- then make up something
211 except Exception:
212 return '<%s instance at %#x>' % (x.__class__.__name__, id(x))
213 if len(s) > self.maxother:
214 i = max(0, (self.maxother-3)//2)
215 j = max(0, self.maxother-3-i)
216 s = s[:i] + self.fillvalue + s[len(s)-j:]
217 return s
218
219
220def _possibly_sorted(x):

Callers 1

repr1Method · 0.95

Calls 2

idFunction · 0.85
reprMethod · 0.45

Tested by

no test coverage detected