def isdescriptor(x):
 for item in ('__get__', '__set__', '__delete__'):
  if hasattr(safe_getattr(x, item, None), '__call__'):
   return True
 return False

def isdescriptor ( x ) : for item in ( '__get__' , '__set__' , '__delete__' ) : if hasattr ( safe_getattr ( x , item , None ) , '__call__' ) : return True return False
check if the object is some kind of descriptor .