python容易出错的返回值

2021-04-24 04:27

阅读:437

标签: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)
    #打印结果?

 

python容易出错的返回值

标签:one   div   出错   set   pre   内存   打印   gis   返回   

原文地址:https://www.cnblogs.com/Fmaj7/p/13266800.html


评论


亲,登录后才可以留言!