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

Class MyList

IPython/lib/tests/test_pretty.py:22–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20
21
22class MyList(object):
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 1

test_indentationFunction · 0.85

Calls

no outgoing calls

Tested by 1

test_indentationFunction · 0.68