MCPcopy Index your code
hub / github.com/RustPython/RustPython / _pprint_chain_map

Method _pprint_chain_map

Lib/pprint.py:517–530  ·  view source on GitHub ↗
(self, object, stream, indent, allowance, context, level)

Source from the content-addressed store, hash-verified

515 _dispatch[_collections.Counter.__repr__] = _pprint_counter
516
517 def _pprint_chain_map(self, object, stream, indent, allowance, context, level):
518 if not len(object.maps):
519 stream.write(repr(object))
520 return
521 cls = object.__class__
522 stream.write(cls.__name__ + '(')
523 indent += len(cls.__name__) + 1
524 for i, m in enumerate(object.maps):
525 if i == len(object.maps) - 1:
526 self._format(m, stream, indent, allowance + 1, context, level)
527 stream.write(')')
528 else:
529 self._format(m, stream, indent, 1, context, level)
530 stream.write(',\n' + ' ' * indent)
531
532 _dispatch[_collections.ChainMap.__repr__] = _pprint_chain_map
533

Callers

nothing calls this directly

Calls 5

_formatMethod · 0.95
lenFunction · 0.85
reprFunction · 0.85
enumerateFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected