本文整理汇总了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) + ")"