8000 bpo-42345: Fix hash implementation of typing.Literal by uriyyo · Pull Request #23383 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-42345: Fix hash implementation of typing.Literal #23383

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

Merged
merged 2 commits into from
Nov 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Remove incorrect hash tests
  • Loading branch information
uriyyo committed Nov 19, 2020
commit 85a21a856a50a310f94249a0202d211416dfd9d3
4 changes: 0 additions & 4 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,10 +570,6 @@ def test_equal(self):
self.assertEqual(Literal[1, 2, 3], Literal[1, 2, 3, 3])

def test_hash(self):
self.assertNotEqual(hash(Literal[0]), hash(Literal[False]))
self.assertNotEqual(hash(Literal[True]), hash(Literal[1]))
self.assertNotEqual(hash(Literal[1]), hash(Literal[2]))
self.assertNotEqual(hash(Literal[1, True]), hash(Literal[1]))
self.assertEqual(hash(Literal[1]), hash(Literal[1]))
self.assertEqual(hash(Literal[1, 2]), hash(Literal[2, 1]))
self.assertEqual(hash(Literal[1, 2, 3]), hash(Literal[1, 2, 3, 3]))
Expand Down
0