|
11 | 11 | from enum import Enum |
12 | 12 | from copy import deepcopy |
13 | 13 | from math import isclose as is_close |
14 | | -from collections.abc import Mapping, Iterable |
| 14 | +from collections.abc import Mapping, Iterable, Sequence |
15 | 15 | from collections import defaultdict |
16 | 16 | from itertools import zip_longest |
17 | 17 | from ordered_set import OrderedSet |
|
23 | 23 | number_to_string, datetime_normalize, KEY_TO_VAL_STR, booleans, |
24 | 24 | np_ndarray, get_numpy_ndarray_rows, OrderedSetPlus, RepeatedTimer, |
25 | 25 | TEXT_VIEW, TREE_VIEW, DELTA_VIEW, detailed__dict__, add_root_to_paths, |
26 | | - np, get_truncate_datetime, dict_, CannotCompare, ENUM_IGNORE_KEYS) |
| 26 | + np, get_truncate_datetime, dict_, CannotCompare, ENUM_INCLUDE_KEYS) |
27 | 27 | from deepdiff.serialization import SerializationMixin |
28 | 28 | from deepdiff.distance import DistanceMixin |
29 | 29 | from deepdiff.model import ( |
@@ -395,8 +395,8 @@ def unmangle(attribute): |
395 | 395 | return {i: getattr(object, unmangle(i)) for i in all_slots} |
396 | 396 |
|
397 | 397 | def _diff_enum(self, level, parents_ids=frozenset(), local_tree=None): |
398 | | - t1 = detailed__dict__(level.t1, ignore_private_variables=self.ignore_private_variables, ignore_keys=ENUM_IGNORE_KEYS) |
399 | | - t2 = detailed__dict__(level.t2, ignore_private_variables=self.ignore_private_variables, ignore_keys=ENUM_IGNORE_KEYS) |
| 398 | + t1 = detailed__dict__(level.t1, include_keys=ENUM_INCLUDE_KEYS) |
| 399 | + t2 = detailed__dict__(level.t2, include_keys=ENUM_INCLUDE_KEYS) |
400 | 400 |
|
401 | 401 | self._diff_dict( |
402 | 402 | level, |
@@ -727,7 +727,13 @@ def _diff_iterable_in_order(self, level, parents_ids=frozenset(), _original_type |
727 | 727 | else: |
728 | 728 | child_relationship_class = NonSubscriptableIterableRelationship |
729 | 729 |
|
730 | | - if self._all_values_basic_hashable(level.t1) and self._all_values_basic_hashable(level.t2) and self.iterable_compare_func is None: |
| 730 | + if ( |
| 731 | + isinstance(level.t1, Sequence) |
| 732 | + and isinstance(level.t2, Sequence) |
| 733 | + and self._all_values_basic_hashable(level.t1) |
| 734 | + and self._all_values_basic_hashable(level.t2) |
| 735 | + and self.iterable_compare_func is None |
| 736 | + ): |
731 | 737 | local_tree_pass = TreeResult() |
732 | 738 | self._diff_ordered_iterable_by_difflib( |
733 | 739 | level, |
|
0 commit comments