Files
RustPython/extra_tests/snippets/builtin_hash.py
T
Rex Ledesma 4e2e0b41c6 chore: add ruff format --check (#5774)
* chore: add `ruff format --check`

* fix tests
2025-05-12 14:20:01 +09:00

23 lines
379 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([])