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

Method repr_instance

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

Source from the content-addressed store, hash-verified

141 return s
142
143 def repr_instance(self, x, level):
144 try:
145 s = builtins.repr(x)
146 # Bugs in x.__repr__() can cause arbitrary
147 # exceptions -- then make up something
148 except Exception:
149 return '<%s instance at %#x>' % (x.__class__.__name__, id(x))
150 if len(s) > self.maxother:
151 i = max(0, (self.maxother-3)//2)
152 j = max(0, self.maxother-3-i)
153 s = s[:i] + self.fillvalue + s[len(s)-j:]
154 return s
155
156
157def _possibly_sorted(x):

Callers 1

repr1Method · 0.95

Calls 3

maxFunction · 0.85
idFunction · 0.50
reprMethod · 0.45

Tested by

no test coverage detected