Quick comparison using unordered rows
(self, result1: List[Tuple], result2: List[Tuple], order_matters: bool)
| 119 | return tuple(sorted(row, key=lambda x: str(x) + str(type(x)))) |
| 120 | |
| 121 | def quick_rej(self, result1: List[Tuple], result2: List[Tuple], order_matters: bool) -> bool: |
| 122 | """Quick comparison using unordered rows""" |
| 123 | s1 = [self.unorder_row(row) for row in result1] |
| 124 | s2 = [self.unorder_row(row) for row in result2] |
| 125 | if order_matters: |
| 126 | return s1 == s2 |
| 127 | else: |
| 128 | return set(s1) == set(s2) |
| 129 | |
| 130 | def multiset_eq(self, l1: List, l2: List) -> bool: |
| 131 | """Check if two lists contain same elements with same frequencies""" |