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)
예제 #2
0
파일: mapper.py 프로젝트: gizm0bill/Ally-Py
 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)
예제 #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)
예제 #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)