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

[BUG] "functional change" to __hash__ #8

Closed
lurch opened this issue Jan 27, 2020 · 1 comment
Closed

[BUG] "functional change" to __hash__ #8

lurch opened this issue Jan 27, 2020 · 1 comment
Labels
Status: Fixed Now it works! Type: Bug Something isn't working

Comments

@lurch
Copy link
Contributor

lurch commented Jan 27, 2020

OS version:
Ubuntu 14.04.6 x64

Python3 version (python3 -V -V):
Python 3.6.8 (default, Dec 25 2018, 00:00:00)
[GCC 4.8.4]

Steps to reproduce:

>>> from frozendict import frozendict
>>> fd1 = frozendict({'a': 'b', 1:2})
>>> fd2 = frozendict({'a': 'b', 1:2})
>>> fd3 = frozendict({1:2, 'a': 'b'})
>>> fd1 == fd2
True
>>> fd2 == fd3
True
>>> fd1 == fd3
True
>>> hash(fd1)
7248413867072730019
>>> hash(fd2)
7248413867072730019
>>> hash(fd3)
6961149576487961955

Note that fd2 == fd3 but hash(fd2) != hash(fd3). When I tried running this code yesterday (prior to 0125b86 ) the hash values for fd2 and fd3 equalled (hash(fd2) == hash(fd3)).

@lurch lurch added the Type: Bug Something isn't working label Jan 27, 2020
@Marco-Sulla
Copy link
Owner

Ok, now I remember why the first time I considered to use tuple and I dismissed it...

Fixed with 10303a8.

@Marco-Sulla Marco-Sulla added the Status: Fixed Now it works! label Dec 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Fixed Now it works! Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants