python容易出错的返回值
2021-04-24 04:27
标签:one div 出错 set pre 内存 打印 gis 返回 python容易出错的返回值 标签:one div 出错 set pre 内存 打印 gis 返回 原文地址:https://www.cnblogs.com/Fmaj7/p/13266800.htmlclass _ActionsContainer(object):
def __init__(self):
self._registries = {}
def register(self, registry_name, value, object):
registry = self._registries.setdefault(registry_name, {}) #此处setdefault参数相当于key,vaule,最终返回value,次value与registry共享内存
print(registry)
print(self._registries)
registry[value] = object
if __name__ == ‘__main__‘:
action = _ActionsContainer()
action.register(‘action‘, None, ‘xxx‘)
#打印结果?
上一篇:Java软件工程师就业前景如何?
下一篇:【JavaScript】数组