Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: Different hash for same dictionaries problem #32

Merged
merged 2 commits into from
Aug 30, 2024

Commits on Apr 19, 2024

  1. When merging unhashable types, the hash is calculated based on `str(o…

    …bj)`. The problem appears when the hash is calculated for two dictionaries like
    
    `a = {'foo': 1, 'bar': 2}` and `b = {'bar': 2, 'foo': 1}.`
    In this case, the calculated hashes obviously don't match, though from any other perspective, the dictionaries have no difference.
    I suggest sorting keys in the dictionary alphabetically on the dict->str conversion.
    
    I'm not a professional programmer so please check if my logic is valid and nothing is broken
    alexeykomp committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    a974b54 View commit details
    Browse the repository at this point in the history
  2. reformat

    alexeykomp committed Apr 19, 2024
    Configuration menu
    Copy the full SHA
    3782e86 View commit details
    Browse the repository at this point in the history