typed_python icon indicating copy to clipboard operation
typed_python copied to clipboard

hashing unhashable named tuples causes system error

Open guslonergan opened this issue 3 years ago • 1 comments

hash(NamedTuple(x=list)(x=[]))

guslonergan avatar Jun 18 '21 16:06 guslonergan

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)())

guslonergan avatar Jun 18 '21 16:06 guslonergan