def __instancecheck__(cls, instance):
     if _has_concrete_method(cls, "__instancecheck__"):
         return cls.__instancecheck__(instance)
     else:
         # If __instancheck__ NOT redefined
         #   OR if it is redefined, but as an abstractmethod
         return ABCMeta.__instancecheck__(cls, instance)
Exemple #2
0
 def __instancecheck__(self, instance):
     '''
     @see: ABCMeta.__instancecheck__
     '''
     if ABCMeta.__instancecheck__(self, instance): return True
     if self is not MappedSupport: return False
     return isinstance(getattr(instance, '__mapper__', None), Mapper)
Exemple #3
0
 def __instancecheck__(self, instance):
     '''
     @see: ABCMeta.__instancecheck__
     '''
     if ABCMeta.__instancecheck__(self, instance): return True
     if self is not TypeSupport: return False
     return isinstance(getattr(instance, '_ally_type', None), Type)
Exemple #4
0
 def __instancecheck__(self, instance):
     '''
     @see: ABCMeta.__instancecheck__
     '''
     if ABCMeta.__instancecheck__(self, instance): return True
     if self is not MappedSupport: return False
     return isinstance(getattr(instance, '__mapper__', None), Mapper)