-
Hi, I am using the diff() method to compare two json files and would like to ignore the oder changes in array, is it possible?
should be equal to:
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
No, this is not possible. Best would be if you would sort the array yourself before calling diff. |
Beta Was this translation helpful? Give feedback.
-
Just for context ignoring the order of all arrays in the hierachy to find the minimal diff is computationally very expensive as soon as you nest a couple arrays. (I know the whole "python is slow" stuff didn't help this case but the point remains that very pathological cases make it hard to compute in a bounded time) |
Beta Was this translation helpful? Give feedback.
No, this is not possible. Best would be if you would sort the array yourself before calling diff.