| 20 | |
| 21 | |
| 22 | class 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 | |
| 39 | class MyDict(dict): |
no outgoing calls