List[uint64] is not like a type but just for annotation, same for other Generics with __args__, Vector/BytesN work, because their metaclasses produce non-parametrized types, so don't check vector values when type contains args
This commit is contained in:
parent
1cc7c7309d
commit
b9abc5f2cf
|
@ -246,8 +246,8 @@ class Vector(metaclass=VectorMeta):
|
|||
|
||||
self.items = list(args)
|
||||
|
||||
# cannot check non-type objects
|
||||
if isinstance(cls.elem_type, type):
|
||||
# cannot check non-type objects, or parametrized types
|
||||
if isinstance(cls.elem_type, type) and not hasattr(cls.elem_type, '__args__'):
|
||||
for i, item in enumerate(self.items):
|
||||
if not issubclass(type(item), cls.elem_type):
|
||||
raise TypeError("Typed vector cannot hold differently typed value"
|
||||
|
|
Loading…
Reference in New Issue