You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:ref:`ignore_encoding_errors_label` If you want to get away with UnicodeDecodeError without passing explicit character encodings, set this option to True. If you want to make sure the encoding is done properly, keep this as False and instead pass an explicit list of character encodings to be considered via the :ref:`encodings_label` parameter.
130
130
131
131
132
+
zip_ordered_iterables: Boolean, default = False
133
+
:ref:`zip_ordered_iterables_label`:
134
+
When comparing ordered iterables such as lists, DeepDiff tries to find the smallest difference between the two iterables to report. That means that items in the two lists are not paired individually in the order of appearance in the iterables. Sometimes, that is not the desired behavior. Set this flag to True to make DeepDiff pair and compare the items in the iterables in the order they appear.
135
+
132
136
iterable_compare_func:
133
137
:ref:`iterable_compare_func_label`:
134
138
There are times that we want to guide DeepDiff as to what items to compare with other items. In such cases we can pass a iterable_compare_func that takes a function pointer to compare two items. The function takes three parameters (x, y, level) and should return True if it is a match, False if it is not a match or raise CannotCompare if it is unable to compare the two.
cache_purge_level defines what objects in DeepDiff should be deleted to free the memory once the diff object is calculated. If this value is set to zero, most of the functionality of the diff object is removed and the most memory is released. A value of 1 preserves all the functionalities of the diff object. A value of 2 also preserves the cache and hashes that were calculated during the diff calculations. In most cases the user does not need to have those objects remained in the diff unless for investigation purposes.
242
242
243
243
244
+
.. _zip_ordered_iterables_label:
245
+
246
+
Zip Ordered Iterables
247
+
---------------------
248
+
249
+
zip_ordered_iterables: Boolean, default = False
250
+
When comparing ordered iterables such as lists, DeepDiff tries to find the smallest difference between the two iterables to report. That means that items in the two lists are not paired individually in the order of appearance in the iterables. Sometimes, that is not the desired behavior. Set this flag to True to make DeepDiff pair and compare the items in the iterables in the order they appear.
251
+
252
+
253
+
>>> from pprint import pprint
254
+
>>> from deepdiff import DeepDiff
255
+
>>> t1 = ["a", "b", "d", "e"]
256
+
>>> t2 = ["a", "b", "c", "d", "e"]
257
+
>>> DeepDiff(t1, t2)
258
+
{'iterable_item_added': {'root[2]': 'c'}}
259
+
260
+
When this flag is set to True and ignore_order=False, diffing will be faster.
0 commit comments