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
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
GitHub fields:
assignee = None closed_at = <Date 2021-07-21.23:59:44.967> created_at = <Date 2021-07-21.21:32:14.420> labels = ['type-bug', 'library', '3.9'] title = 'frozenset.__hash__ vs. Set._hash' updated_at = <Date 2021-07-22.00:23:47.837> user = 'https://github.com/Prometheus3375'
bugs.python.org fields:
activity = <Date 2021-07-22.00:23:47.837> actor = 'rhettinger' assignee = 'none' closed = True closed_date = <Date 2021-07-21.23:59:44.967> closer = 'rhettinger' components = ['Library (Lib)'] creation = <Date 2021-07-21.21:32:14.420> creator = 'Prometheus3375' dependencies = [] files = [] hgrepos = [] issue_num = 44704 keywords = ['patch'] message_count = 4.0 messages = ['397963', '397968', '397970', '397972', '397973'] nosy_count = 4.0 nosy_names = ['rhettinger', 'miss-islington', 'Dennis Sweeney', 'Prometheus3375'] pr_nums = ['27281', '27282', '27283'] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue44704' versions = ['Python 3.9']
The text was updated successfully, but these errors were encountered:
In docstring of Set._hash in _collections_abc.py is written: "We match the algorithm used by the built-in frozenset type."
But >>> s = frozenset({i for i in range(10)}) >>> hash(s) 3895031357313128696 >>> Set._hash(s) 3914343279946282847
Looks like Set._hash is different.
Sorry, something went wrong.
I opened a PR. It looks like frozenset.__hash__ changed in #49444 and #49485, but Set._hash wasn't updated accordingly.
New changeset c878f5d by Dennis Sweeney in branch 'main': bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) c878f5d
New changeset e0ef816 by Miss Islington (bot) in branch '3.9': bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) (GH-27283) e0ef816
New changeset 4194f14 by Miss Islington (bot) in branch '3.10': bpo-44704: Make Set._hash consistent with frozenset.__hash__ (GH-27281) (GH-27282) 4194f14
No branches or pull requests
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: