本文整理汇总了Python中Dictionary.Dictionary.__update__方法的典型用法代码示例。如果您正苦于以下问题:Python Dictionary.__update__方法的具体用法?Python Dictionary.__update__怎么用?Python Dictionary.__update__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dictionary.Dictionary
的用法示例。
在下文中一共展示了Dictionary.__update__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Method
# 需要导入模块: from Dictionary import Dictionary [as 别名]
# 或者: from Dictionary.Dictionary import __update__ [as 别名]
class Method(object):
def __init__(self, aHt, aId, aCode, aLnotab, aIdClass, aArgs):
self.hT = aHt
self.locals = Dictionary(self.hT)
self.argument = ()
self.lnotab = aLnotab
self.code = aCode
self.name = aCode.co_name
self.idClass = aIdClass
self.Id = aId
self.__updateArgument__(aArgs)
def __getId__(self):
return self.Id
def __getLnotab__(self):
return self.lnotab
def __getLocals__(self):
return self.locals
def __getTarget__(self):
return self.idClass
def __getArgs__(self):
return self.argument
def __getArgsValues__(self, aLocals):
argValues = ()
for name in self.argument:
if aLocals.has_key(name):
argValues = argValues + (aLocals[name],)
#TODO: analizar caso para cuando sean tuple, list, dict
return argValues
def __updateArgument__(self, aArgs):
#no se registra self como argumento valido
for theArg in aArgs:
if not theArg == 'self':
self.argument += (theArg,)
theParentId = self.Id
if self.hT.FLAG_DEBUGG:
for theIndex in range(len(aArgs)):
if not aArgs[theIndex] == 'self':
print self.hT.itsEvents['register'],
print self.hT.itsObjects['local'],
print theIndex + 1,
print theParentId,
print aArgs[theIndex]
raw_input()
def __registerLocals__(self, aLocal):
self.locals.__update__(aLocal,self.Id,self.argument)