MCPcopy Create free account
hub / github.com/ipython/ipython / inner

Function inner

IPython/lib/pretty.py:546–559  ·  view source on GitHub ↗
(obj, p, cycle)

Source from the content-addressed store, hash-verified

544 the default pprint for tuples, dicts, and lists.
545 """
546 def inner(obj, p, cycle):
547 if cycle:
548 return p.text(start + '...' + end)
549 step = len(start)
550 p.begin_group(step, start)
551 for idx, x in p._enumerate(obj):
552 if idx:
553 p.text(',')
554 p.breakable()
555 p.pretty(x)
556 if len(obj) == 1 and type(obj) is tuple:
557 # Special case for 1-item tuples.
558 p.text(',')
559 p.end_group(step, end)
560 return inner
561
562

Callers

nothing calls this directly

Calls 7

_sorted_for_pprintFunction · 0.85
begin_groupMethod · 0.80
_enumerateMethod · 0.80
breakableMethod · 0.80
prettyMethod · 0.80
end_groupMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected