@@ -219,8 +219,8 @@ def __instancecheck__(cls, # type: VTypeMeta
219219 :param obj:
220220 :return:
221221 """
222- # first make sure that `obj` is an instance of all bases (this includes value validation in case of VTypes)
223- if not all (isinstance (obj , t ) for t in cls .__bases__ if t is not VType ):
222+ # first make sure that `obj` is an instance of all the base types
223+ if not all (isinstance (obj , t ) for t in cls .__type__ ):
224224 return False
225225
226226 # then validate the value with validators on this class
@@ -283,12 +283,12 @@ def has_valid_type(cls, obj):
283283 :param obj:
284284 :return:
285285 """
286- # should be an instance of all base types (except VType)
286+ # should be an instance of all base types
287287 # for VTypes, we rely on has_valid_type instead of isinstance to avoid value check
288- for t in cls .__bases__ :
289- if t is VType :
290- continue
291- elif isinstance (t , VTypeMeta ):
288+ for t in cls .__type__ :
289+ # if t is VType:
290+ # continue
291+ if isinstance (t , VTypeMeta ):
292292 if not t .has_valid_type (obj ):
293293 return False
294294 elif not isinstance (obj , t ):
@@ -319,10 +319,10 @@ def has_valid_value(cls,
319319 return False
320320
321321 if inherited_validators :
322- for t in cls .__bases__ :
323- if t is VType :
324- continue
325- elif isinstance (t , VTypeMeta ) and not t .has_valid_value (obj , inherited_validators = True ):
322+ for t in cls .__type__ :
323+ # if t is VType:
324+ # continue
325+ if isinstance (t , VTypeMeta ) and not t .has_valid_value (obj , inherited_validators = True ):
326326 return False
327327 else :
328328 continue
0 commit comments