Skip to content
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

Option for acknowledging item ordering #361

Closed
ianyoung opened this issue Dec 15, 2022 · 4 comments
Closed

Option for acknowledging item ordering #361

ianyoung opened this issue Dec 15, 2022 · 4 comments

Comments

@ianyoung
Copy link

I've noticed that the hash of an object is the same if a list contained in the object has items moved around. E.g.

obj1 = {"key": [{1: "one"},{2: "two"}]}
obj2 = {"key": [{2: "two"},{1: "one"}]}

Both of the above result in the same hash.

Strictly speaking this should be considered a change and should result in a different hash.

Describe the solution you'd like
I'd ideally like the default handling to acknowledge item ordering and result in a different hash value.

Describe alternatives you've considered
Failing it being the default handling, it would be good if there was an option to set item ordering acknowledgements, resulting in a different hash value.

@seperman
Copy link
Owner

seperman commented Dec 15, 2022 via email

@ianyoung
Copy link
Author

A parameter would be great, thanks!

In my particular use case I have a dynamic list of images inside the dictionary and the first image in the list serves as the featured image. The featured image changes every now and then so I not only need to see if there are changes but changes of item order which are important to capture.

@seperman
Copy link
Owner

Hi @ianyoung
This was resolved in July.
Thanks.

@ianyoung
Copy link
Author

Awesome! Thanks for letting me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants