标签:one div 出错 set pre 内存 打印 gis 返回
class _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‘) #打印结果?
标签:one div 出错 set pre 内存 打印 gis 返回
原文地址:https://www.cnblogs.com/Fmaj7/p/13266800.html