当前位置: 首页>>代码示例>>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;未经允许,请勿转载。