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

Method _repr_pretty_

tests/test_pretty.py:27–38  ·  view source on GitHub ↗
(self, p, cycle)

Source from the content-addressed store, hash-verified

25 self.content = content
26
27 def _repr_pretty_(self, p, cycle):
28 if cycle:
29 p.text("MyList(...)")
30 else:
31 with p.group(3, "MyList(", ")"):
32 for i, child in enumerate(self.content):
33 if i:
34 p.text(",")
35 p.breakable()
36 else:
37 p.breakable("")
38 p.pretty(child)
39
40
41class 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