Returns a new tree, comprising all intervals in self but not in other.
(self, other)
| 399 | return self.discard(Interval(begin, end, data)) |
| 400 | |
| 401 | def difference(self, other): |
| 402 | """ |
| 403 | Returns a new tree, comprising all intervals in self but not |
| 404 | in other. |
| 405 | """ |
| 406 | ivs = set() |
| 407 | for iv in self: |
| 408 | if iv not in other: |
| 409 | ivs.add(iv) |
| 410 | return IntervalTree(ivs) |
| 411 | |
| 412 | def difference_update(self, other): |
| 413 | """ |