(self)
| 485 | yield self.label |
| 486 | |
| 487 | def __repr__(self) -> str: |
| 488 | from pprint import pformat |
| 489 | |
| 490 | if self.left is None and self.right is None: |
| 491 | return f"'{self.label} {(self.color and 'red') or 'blk'}'" |
| 492 | return pformat( |
| 493 | { |
| 494 | f"{self.label} {(self.color and 'red') or 'blk'}": ( |
| 495 | self.left, |
| 496 | self.right, |
| 497 | ) |
| 498 | }, |
| 499 | indent=1, |
| 500 | ) |
| 501 | |
| 502 | def __eq__(self, other: object) -> bool: |
| 503 | """Test if two trees are equal.""" |
nothing calls this directly
no outgoing calls
no test coverage detected