Get a repr-like string for the data, but truncate it at "maxlen" bytes (ending the object graph traversal as soon as you do)
(self, maxlen)
| 222 | field_obj.write_repr(out, visited) |
| 223 | |
| 224 | def get_truncated_repr(self, maxlen): |
| 225 | ''' |
| 226 | Get a repr-like string for the data, but truncate it at "maxlen" bytes |
| 227 | (ending the object graph traversal as soon as you do) |
| 228 | ''' |
| 229 | out = TruncatedStringIO(maxlen) |
| 230 | try: |
| 231 | self.write_repr(out, set()) |
| 232 | except StringTruncated: |
| 233 | # Truncation occurred: |
| 234 | return out.getvalue() + '...(truncated)' |
| 235 | |
| 236 | # No truncation occurred: |
| 237 | return out.getvalue() |
| 238 | |
| 239 | def type(self): |
| 240 | return PyTypeObjectPtr(self.field('ob_type')) |
nothing calls this directly
no test coverage detected