diff options
author | Damien George <damien.p.george@gmail.com> | 2014-11-15 18:30:01 +0000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-11-15 18:30:01 +0000 |
commit | 4df85e49d48a76246d97383ac6a5d63e1ce2be60 (patch) | |
tree | 5e90f7c66dc0bf6873152a2edc1bfa6fed59ba3d /tests/basics/builtin_hash.py | |
parent | e00eeaf4cd4f937939d6713716255116cb06b7b9 (diff) |
tests: Add test for hash of user defined class.
Diffstat (limited to 'tests/basics/builtin_hash.py')
-rw-r--r-- | tests/basics/builtin_hash.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/basics/builtin_hash.py b/tests/basics/builtin_hash.py new file mode 100644 index 000000000..c4c7019b4 --- /dev/null +++ b/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}) |