(self, p, cycle)
| 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 | |
| 41 | class MyDict(dict): |