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

Method _repr_pretty_

IPython/lib/tests/test_pretty.py:25–36  ·  view source on GitHub ↗
(self, p, cycle)

Source from the content-addressed store, hash-verified

23 def __init__(self, content):
24 self.content = content
25 def _repr_pretty_(self, p, cycle):
26 if cycle:
27 p.text("MyList(...)")
28 else:
29 with p.group(3, "MyList(", ")"):
30 for (i, child) in enumerate(self.content):
31 if i:
32 p.text(",")
33 p.breakable()
34 else:
35 p.breakable("")
36 p.pretty(child)
37
38
39class MyDict(dict):

Callers

nothing calls this directly

Calls 4

groupMethod · 0.80
breakableMethod · 0.80
prettyMethod · 0.80
textMethod · 0.45

Tested by

no test coverage detected