Browse Source

tests: Add test for hash of user defined class.

pull/971/merge
Damien George 10 years ago
parent
commit
4df85e49d4
  1. 10
      tests/basics/builtin_hash.py

10
tests/basics/builtin_hash.py

@ -0,0 +1,10 @@
# test builtin hash function
class A:
def __hash__(self):
return 123
def __repr__(self):
return "a instance"
print(hash(A()))
print({A():1})
Loading…
Cancel
Save