Files
RustPython/extra_tests/snippets/builtin_hash.py
2022-05-04 02:54:59 +09:00

24 lines
380 B
Python

from testutils import assert_raises
class A:
pass
assert type(hash(None)) is int
assert type(hash(object())) is int
assert type(hash(A())) is int
assert type(hash(1)) is int
assert type(hash(1.1)) is int
assert type(hash("")) is int
with assert_raises(TypeError):
hash({})
with assert_raises(TypeError):
hash(set())
with assert_raises(TypeError):
hash([])