typed_python
typed_python copied to clipboard
hashing unhashable named tuples causes system error
hash(NamedTuple(x=list)(x=[]))
Same for Alternatives. Also, the following do not produce errors at all (not sure if this is intentional):
hash(ListOf(int)())
class A(Class):
x = Member(list)
hash(A(x=[]))
class A(Class):
x = Member(Dict(int, int))
hash(A(x=Dict(int, int)()))
Although this does (produce a type error, not a system error):
hash(Dict(int, int)())