Lines Matching refs:object

47 def pprint(object, stream=None, indent=1, width=80, depth=None, *,  argument
53 printer.pprint(object)
55 def pformat(object, indent=1, width=80, depth=None, *, compact=False): argument
58 compact=compact).pformat(object)
60 def saferepr(object): argument
62 return _safe_repr(object, {}, None, 0)[0]
64 def isreadable(object): argument
66 return _safe_repr(object, {}, None, 0)[1]
68 def isrecursive(object): argument
70 return _safe_repr(object, {}, None, 0)[2]
138 def pprint(self, object): argument
139 self._format(object, self._stream, 0, 0, {}, 0)
142 def pformat(self, object): argument
144 self._format(object, sio, 0, 0, {}, 0)
147 def isrecursive(self, object): argument
148 return self.format(object, {}, 0, 0)[2]
150 def isreadable(self, object): argument
151 s, readable, recursive = self.format(object, {}, 0, 0)
154 def _format(self, object, stream, indent, allowance, context, level): argument
155 objid = id(object)
157 stream.write(_recursion(object))
161 rep = self._repr(object, context, level)
164 p = self._dispatch.get(type(object).__repr__, None)
167 p(self, object, stream, indent, allowance, context, level + 1)
170 elif isinstance(object, dict):
172 self._pprint_dict(object, stream, indent, allowance,
180 def _pprint_dict(self, object, stream, indent, allowance, context, level): argument
185 length = len(object)
187 items = sorted(object.items(), key=_safe_tuple)
194 def _pprint_ordered_dict(self, object, stream, indent, allowance, context, level): argument
195 if not len(object):
196 stream.write(repr(object))
198 cls = object.__class__
200 self._format(list(object.items()), stream,
207 def _pprint_list(self, object, stream, indent, allowance, context, level): argument
209 self._format_items(object, stream, indent, allowance + 1,
215 def _pprint_tuple(self, object, stream, indent, allowance, context, level): argument
217 endchar = ',)' if len(object) == 1 else ')'
218 self._format_items(object, stream, indent, allowance + len(endchar),
224 def _pprint_set(self, object, stream, indent, allowance, context, level): argument
225 if not len(object):
226 stream.write(repr(object))
228 typ = object.__class__
236 object = sorted(object, key=_safe_key)
237 self._format_items(object, stream, indent, allowance + len(endchar),
244 def _pprint_str(self, object, stream, indent, allowance, context, level): argument
246 if not len(object):
247 write(repr(object))
250 lines = object.splitlines(True)
295 def _pprint_bytes(self, object, stream, indent, allowance, context, level): argument
297 if len(object) <= 4:
298 write(repr(object))
306 for rep in _wrap_bytes_repr(object, self._width - indent, allowance):
316 def _pprint_bytearray(self, object, stream, indent, allowance, context, level): argument
319 self._pprint_bytes(bytes(object), stream, indent + 10,
325 def _pprint_mappingproxy(self, object, stream, indent, allowance, context, level): argument
327 self._format(object.copy(), stream, indent + 13, allowance + 1,
391 def _repr(self, object, context, level): argument
392 repr, readable, recursive = self.format(object, context.copy(),
400 def format(self, object, context, maxlevels, level): argument
405 return _safe_repr(object, context, maxlevels, level)
407 def _pprint_default_dict(self, object, stream, indent, allowance, context, level): argument
408 if not len(object):
409 stream.write(repr(object))
411 rdf = self._repr(object.default_factory, context, level)
412 cls = object.__class__
415 self._pprint_dict(object, stream, indent, allowance + 1, context, level)
420 def _pprint_counter(self, object, stream, indent, allowance, context, level): argument
421 if not len(object):
422 stream.write(repr(object))
424 cls = object.__class__
428 items = object.most_common()
436 def _pprint_chain_map(self, object, stream, indent, allowance, context, level): argument
437 if not len(object.maps):
438 stream.write(repr(object))
440 cls = object.__class__
443 for i, m in enumerate(object.maps):
444 if i == len(object.maps) - 1:
453 def _pprint_deque(self, object, stream, indent, allowance, context, level): argument
454 if not len(object):
455 stream.write(repr(object))
457 cls = object.__class__
461 if object.maxlen is None:
462 self._format_items(object, stream, indent, allowance + 2,
466 self._format_items(object, stream, indent, 2,
468 rml = self._repr(object.maxlen, context, level)
473 def _pprint_user_dict(self, object, stream, indent, allowance, context, level): argument
474 self._format(object.data, stream, indent, allowance, context, level - 1)
478 def _pprint_user_list(self, object, stream, indent, allowance, context, level): argument
479 self._format(object.data, stream, indent, allowance, context, level - 1)
483 def _pprint_user_string(self, object, stream, indent, allowance, context, level): argument
484 self._format(object.data, stream, indent, allowance, context, level - 1)
490 def _safe_repr(object, context, maxlevels, level): argument
491 typ = type(object)
493 return repr(object), True, False
497 if not object:
499 objid = id(object)
503 return _recursion(object), False, True
511 items = sorted(object.items(), key=_safe_tuple)
525 if not object:
528 elif len(object) == 1:
531 if not object:
534 objid = id(object)
538 return _recursion(object), False, True
545 for o in object:
555 rep = repr(object)
561 def _recursion(object): argument
563 % (type(object).__name__, id(object)))
566 def _perfcheck(object=None): argument
568 if object is None:
569 object = [("string", (1, 2), [3, 4], {5: 6, 7: 8})] * 100000
572 _safe_repr(object, {}, None, 0)
574 p.pformat(object)
579 def _wrap_bytes_repr(object, width, allowance): argument
581 last = len(object) // 4 * 4
582 for i in range(0, len(object), 4):
583 part = object[i: i+4]