• Home
  • Raw
  • Download

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, *, argument
59 compact=compact, sort_dicts=sort_dicts).pformat(object)
61 def pp(object, *args, sort_dicts=False, **kwargs): argument
63 pprint(object, *args, sort_dicts=sort_dicts, **kwargs)
65 def saferepr(object): argument
67 return _safe_repr(object, {}, None, 0, True)[0]
69 def isreadable(object): argument
71 return _safe_repr(object, {}, None, 0, True)[1]
73 def isrecursive(object): argument
75 return _safe_repr(object, {}, None, 0, True)[2]
147 def pprint(self, object): argument
148 self._format(object, self._stream, 0, 0, {}, 0)
151 def pformat(self, object): argument
153 self._format(object, sio, 0, 0, {}, 0)
156 def isrecursive(self, object): argument
157 return self.format(object, {}, 0, 0)[2]
159 def isreadable(self, object): argument
160 s, readable, recursive = self.format(object, {}, 0, 0)
163 def _format(self, object, stream, indent, allowance, context, level): argument
164 objid = id(object)
166 stream.write(_recursion(object))
170 rep = self._repr(object, context, level)
173 p = self._dispatch.get(type(object).__repr__, None)
176 p(self, object, stream, indent, allowance, context, level + 1)
179 elif isinstance(object, dict):
181 self._pprint_dict(object, stream, indent, allowance,
189 def _pprint_dict(self, object, stream, indent, allowance, context, level): argument
194 length = len(object)
197 items = sorted(object.items(), key=_safe_tuple)
199 items = object.items()
206 def _pprint_ordered_dict(self, object, stream, indent, allowance, context, level): argument
207 if not len(object):
208 stream.write(repr(object))
210 cls = object.__class__
212 self._format(list(object.items()), stream,
219 def _pprint_list(self, object, stream, indent, allowance, context, level): argument
221 self._format_items(object, stream, indent, allowance + 1,
227 def _pprint_tuple(self, object, stream, indent, allowance, context, level): argument
229 endchar = ',)' if len(object) == 1 else ')'
230 self._format_items(object, stream, indent, allowance + len(endchar),
236 def _pprint_set(self, object, stream, indent, allowance, context, level): argument
237 if not len(object):
238 stream.write(repr(object))
240 typ = object.__class__
248 object = sorted(object, key=_safe_key)
249 self._format_items(object, stream, indent, allowance + len(endchar),
256 def _pprint_str(self, object, stream, indent, allowance, context, level): argument
258 if not len(object):
259 write(repr(object))
262 lines = object.splitlines(True)
307 def _pprint_bytes(self, object, stream, indent, allowance, context, level): argument
309 if len(object) <= 4:
310 write(repr(object))
318 for rep in _wrap_bytes_repr(object, self._width - indent, allowance):
328 def _pprint_bytearray(self, object, stream, indent, allowance, context, level): argument
331 self._pprint_bytes(bytes(object), stream, indent + 10,
337 def _pprint_mappingproxy(self, object, stream, indent, allowance, context, level): argument
339 self._format(object.copy(), stream, indent + 13, allowance + 1,
345 def _pprint_simplenamespace(self, object, stream, indent, allowance, context, level): argument
346 if type(object) is _types.SimpleNamespace:
351 cls_name = object.__class__.__name__
354 items = object.__dict__.items()
430 def _repr(self, object, context, level): argument
431 repr, readable, recursive = self.format(object, context.copy(),
439 def format(self, object, context, maxlevels, level): argument
444 return _safe_repr(object, context, maxlevels, level, self._sort_dicts)
446 def _pprint_default_dict(self, object, stream, indent, allowance, context, level): argument
447 if not len(object):
448 stream.write(repr(object))
450 rdf = self._repr(object.default_factory, context, level)
451 cls = object.__class__
454 self._pprint_dict(object, stream, indent, allowance + 1, context, level)
459 def _pprint_counter(self, object, stream, indent, allowance, context, level): argument
460 if not len(object):
461 stream.write(repr(object))
463 cls = object.__class__
467 items = object.most_common()
475 def _pprint_chain_map(self, object, stream, indent, allowance, context, level): argument
476 if not len(object.maps):
477 stream.write(repr(object))
479 cls = object.__class__
482 for i, m in enumerate(object.maps):
483 if i == len(object.maps) - 1:
492 def _pprint_deque(self, object, stream, indent, allowance, context, level): argument
493 if not len(object):
494 stream.write(repr(object))
496 cls = object.__class__
500 if object.maxlen is None:
501 self._format_items(object, stream, indent, allowance + 2,
505 self._format_items(object, stream, indent, 2,
507 rml = self._repr(object.maxlen, context, level)
512 def _pprint_user_dict(self, object, stream, indent, allowance, context, level): argument
513 self._format(object.data, stream, indent, allowance, context, level - 1)
517 def _pprint_user_list(self, object, stream, indent, allowance, context, level): argument
518 self._format(object.data, stream, indent, allowance, context, level - 1)
522 def _pprint_user_string(self, object, stream, indent, allowance, context, level): argument
523 self._format(object.data, stream, indent, allowance, context, level - 1)
529 def _safe_repr(object, context, maxlevels, level, sort_dicts): argument
530 typ = type(object)
532 return repr(object), True, False
536 if not object:
538 objid = id(object)
542 return _recursion(object), False, True
550 items = sorted(object.items(), key=_safe_tuple)
552 items = object.items()
566 if not object:
569 elif len(object) == 1:
572 if not object:
575 objid = id(object)
579 return _recursion(object), False, True
586 for o in object:
596 rep = repr(object)
602 def _recursion(object): argument
604 % (type(object).__name__, id(object)))
607 def _perfcheck(object=None): argument
609 if object is None:
610 object = [("string", (1, 2), [3, 4], {5: 6, 7: 8})] * 100000
613 _safe_repr(object, {}, None, 0, True)
615 p.pformat(object)
620 def _wrap_bytes_repr(object, width, allowance): argument
622 last = len(object) // 4 * 4
623 for i in range(0, len(object), 4):
624 part = object[i: i+4]