diff --git a/satella/coding/structures/mixins/hashable.py b/satella/coding/structures/mixins/hashable.py index ff1c4106604fa9659b8455b9e212e6c1471f0dd7..41561f2e07141229167f5bb2319c2189c5ed5a6a 100644 --- a/satella/coding/structures/mixins/hashable.py +++ b/satella/coding/structures/mixins/hashable.py @@ -181,19 +181,16 @@ class OmniHashableMixin(metaclass=ABCMeta): """ Note that this will only compare _HASH_FIELDS_TO_USE """ - return _generic_eq(self, other, False, operator.eq, 'eq', ) + return _generic_eq(self, other, False, operator.eq) def __ne__(self, other) -> bool: - return _generic_eq(self, other, True, operator.ne, 'ne') + return _generic_eq(self, other, True, operator.ne) -def _generic_eq(self, other, truth, comparator, name): +def _generic_eq(self, other, truth, comparator): if not isinstance(other, type(self)): return truth - if not isinstance(other, OmniHashableMixin): - return comparator(self, other) - cmpr_by = self._HASH_FIELDS_TO_USE try: if isinstance(cmpr_by, str): diff --git a/tests/test_coding/test_structures.py b/tests/test_coding/test_structures.py index 0fa0be560e1018474330cd5310168949ad1f80b1..d5734587145b1dce9b9f204c2029c744bb212d2d 100644 --- a/tests/test_coding/test_structures.py +++ b/tests/test_coding/test_structures.py @@ -275,7 +275,7 @@ class TestStructures(unittest.TestCase): self.assertEqual(a, b) self.assertEqual(a, 1) self.assertGreater(a, 0) - self.assertLess(c, 1) + self.assertLess(c, 4) self.assertNotEqual(a, c) self.assertLess(a, c) self.assertGreaterEqual(a, b)