Check if the heap is not empty. >>> rh = RandomizedHeap() >>> bool(rh) False >>> rh.insert(1) >>> bool(rh) True >>> rh.clear() >>> bool(rh) False
(self)
| 200 | return result |
| 201 | |
| 202 | def __bool__(self) -> bool: |
| 203 | """ |
| 204 | Check if the heap is not empty. |
| 205 | |
| 206 | >>> rh = RandomizedHeap() |
| 207 | >>> bool(rh) |
| 208 | False |
| 209 | >>> rh.insert(1) |
| 210 | >>> bool(rh) |
| 211 | True |
| 212 | >>> rh.clear() |
| 213 | >>> bool(rh) |
| 214 | False |
| 215 | """ |
| 216 | return self._root is not None |
| 217 | |
| 218 | |
| 219 | if __name__ == "__main__": |
nothing calls this directly
no outgoing calls
no test coverage detected