Skip to content

Commit 4df85e4

Browse files
committed
tests: Add test for hash of user defined class.
1 parent e00eeaf commit 4df85e4

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tests/basics/builtin_hash.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# test builtin hash function
2+
3+
class A:
4+
def __hash__(self):
5+
return 123
6+
def __repr__(self):
7+
return "a instance"
8+
9+
print(hash(A()))
10+
print({A():1})

0 commit comments

Comments
 (0)