(self,attr)
return value
封装了获取字段值的过程
封装了获取字段值的过程
封装了获取字段值的过程
def __getattribute__(self,attr):
        """
        封装了获取字段值的过程
        """
        value = object.__getattribute__(self,attr)
        if isinstance(value, MemFields):
            print 'locked',self.isLocked()
            if self._cas and not self.isLocked():
                for _ in xrange(10):
                    if not self.lock():
                        time.sleep(0.2)
                        continue
                    break
                else:
                    return None
            return value.getValue()
        return value
def __getattribute__ ( self , attr ) : value = object . __getattribute__ ( self , attr ) if isinstance ( value , MemFields ) : print 'locked' , self . isLocked ( ) if self . _cas and not self . isLocked ( ) : for _ in xrange ( 10 ) : if not self . lock ( ) : time . sleep ( 0.2 ) continue break else : return None return value . getValue ( ) return value