Compare options in a way that is stable for snapshot() -> apply_changes() roundtrip. This is needed because apply_changes() has non-trivial effects for some flags, so Options().apply_changes(options.snapshot()) may result in a (slightly) different object.
(self, other_snapshot: dict[str, object])
| 537 | return new_options |
| 538 | |
| 539 | def compare_stable(self, other_snapshot: dict[str, object]) -> bool: |
| 540 | """Compare options in a way that is stable for snapshot() -> apply_changes() roundtrip. |
| 541 | |
| 542 | This is needed because apply_changes() has non-trivial effects for some flags, so |
| 543 | Options().apply_changes(options.snapshot()) may result in a (slightly) different object. |
| 544 | """ |
| 545 | return ( |
| 546 | Options().apply_changes(self.snapshot()).snapshot() |
| 547 | == Options().apply_changes(other_snapshot).snapshot() |
| 548 | ) |
| 549 | |
| 550 | def build_per_module_cache(self) -> None: |
| 551 | self._per_module_cache = {} |
no test coverage detected