當前位置: 首頁>>代碼示例>>Python>>正文


Python PyUtils.safeEqual方法代碼示例

本文整理匯總了Python中PyUtils.safeEqual方法的典型用法代碼示例。如果您正苦於以下問題:Python PyUtils.safeEqual方法的具體用法?Python PyUtils.safeEqual怎麽用?Python PyUtils.safeEqual使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PyUtils的用法示例。


在下文中一共展示了PyUtils.safeEqual方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: setValueAndUpdateObject

# 需要導入模塊: import PyUtils [as 別名]
# 或者: from PyUtils import safeEqual [as 別名]
 def setValueAndUpdateObject(self, memberName, value, object, container = None):
     """
     Sets the specified value of the specified member and updates the object.
     As a container, specify the object (not proxy object) to which this object is attached with an HAS_A or HAS_MANY relationship.
     """
     info = self._memberDict[memberName]
     newValue = info.interpret(value)
     if PyUtils.safeEqual( newValue, self.__getattribute__(memberName) ) : return
     self.__setattr__(memberName, newValue)
     info.set(object, newValue, container )
開發者ID:MontyThibault,項目名稱:cartwheel-3d-Research-Modifications,代碼行數:12,代碼來源:Proxy.py

示例2: __repr__

# 需要導入模塊: import PyUtils [as 別名]
# 或者: from PyUtils import safeEqual [as 別名]
 def __repr__(self) :
     """
     Creates a representation of this proxy object. This can be evaluated provided the following includes:
       from App.Proxys.All import *
     """
     outMembers = []
     for member in self._members:
         value = self.__getattribute__(member.name)
         if self._verbose and PyUtils.safeEqual(value, member.default) : continue 
         outMember = repr( member.format(value) )
         if self._verbose: outMember = member.name + " = " + outMember
         outMembers.append( outMember )
     return type(self).__name__ + "(" + ','.join(outMembers) + ")"
開發者ID:MontyThibault,項目名稱:cartwheel-3d-Research-Modifications,代碼行數:15,代碼來源:Proxy.py


注:本文中的PyUtils.safeEqual方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。