本文整理匯總了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 )
示例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) + ")"