Calls the given visit() function on this cluster and each nested cluster, breadth-first.
(self, visit=lambda cluster: None)
| 1586 | return a |
| 1587 | |
| 1588 | def traverse(self, visit=lambda cluster: None): |
| 1589 | """ Calls the given visit() function on this cluster and each nested cluster, breadth-first. |
| 1590 | """ |
| 1591 | visit(self) |
| 1592 | for item in self: |
| 1593 | if isinstance(item, Cluster): |
| 1594 | item.traverse(visit) |
| 1595 | |
| 1596 | def __repr__(self): |
| 1597 | return "Cluster(%s)" % list.__repr__(self)[1:-1] |