change to issubclass, hope parametrized external type is ok

This commit is contained in:
protolambda 2019-06-05 18:28:09 +02:00
parent a7554d503c
commit 1cc7c7309d
No known key found for this signature in database
GPG Key ID: EC89FDBB2B4C7623
1 changed files with 1 additions and 1 deletions

View File

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