-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generated patches aren't always the same #151
Generated patches aren't always the same #151
Comments
I ran into this because a unittest was flaky. It's a bit annoying. |
That was the issue I was running into too |
I think I wouldn't even have noticed, if the JsonPatch class had an equality comparison |
This is caused by the use of sets for comparing dict keys in the internals of the library. Sets (unlike dicts in newer versions of Python) do not preserve order. Ordering is determined by the hash values of objects within the set. By default, Python randomizes hashes for security purposes. As a workaround for test cases you can disable this behavior by setting I've submitted #161 which I believe will address this issue without requiring |
On Python 3.6+ (where dict is ordered) I'd expected the following to always return the same results:
This isn't the case though:
The text was updated successfully, but these errors were encountered: