-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
Description
Fields of record or union tag must accept only hashable values. For example, a Python code generated from the following IDL:
record test ({bigint} a);
currently can take values that aren't hashable e.g.:
>>> v = Test(a=frozenset([1, 2, 3]))
>>> hash(v)
-3553164928370265785
>>> v2 = Test(a={1, 2, 3})
>>> hash(v2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/.../test/__init__.py", line 56, in __hash__
return hash((self.a,))
TypeError: unhashable type: 'set'
Expected behavior would be e.g.:
>>> v = Test(a=frozenset([1, 2, 3]))
>>> hash(v)
-3553164928370265785
>>> v2 = Test(a={1, 2, 3})
Traceback (most recent call last):
...
TypeError: a must be hashable