change to issubclass, hope parametrized external type is ok
This commit is contained in:
parent
a7554d503c
commit
1cc7c7309d
|
@ -249,7 +249,7 @@ class Vector(metaclass=VectorMeta):
|
|||
# cannot check non-type objects
|
||||
if isinstance(cls.elem_type, type):
|
||||
for i, item in enumerate(self.items):
|
||||
if not isinstance(item, cls.elem_type):
|
||||
if not issubclass(type(item), cls.elem_type):
|
||||
raise TypeError("Typed vector cannot hold differently typed value"
|
||||
" at index %d. Got type: %s, expected type: %s" % (i, type(item), cls.elem_type))
|
||||
|
||||
|
|
Loading…
Reference in New Issue