mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
24 lines
376 B
Python
24 lines
376 B
Python
|
|
from testutils import assertRaises
|
|
|
|
|
|
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 assertRaises(TypeError):
|
|
hash({})
|
|
|
|
with assertRaises(TypeError):
|
|
hash(set())
|
|
|
|
with assertRaises(TypeError):
|
|
hash([])
|