MCPcopy Index your code
hub / github.com/ipython/ipython / _dict_pprinter_factory

Function _dict_pprinter_factory

IPython/lib/pretty.py:685–704  ·  view source on GitHub ↗

Factory that returns a pprint function used by the default pprint of dicts and dict proxies.

(start, end)

Source from the content-addressed store, hash-verified

683
684
685def _dict_pprinter_factory(start, end):
686 """
687 Factory that returns a pprint function used by the default pprint of
688 dicts and dict proxies.
689 """
690 def inner(obj, p, cycle):
691 if cycle:
692 return p.text('{...}')
693 step = len(start)
694 p.begin_group(step, start)
695 keys = obj.keys()
696 for idx, key in p._enumerate(keys):
697 if idx:
698 p.text(',')
699 p.breakable()
700 p.pretty(key)
701 p.text(': ')
702 p.pretty(obj[key])
703 p.end_group(step, end)
704 return inner
705
706
707def _super_pprint(obj, p, cycle):

Callers 1

pretty.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…