shell.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:true_review_web2py 作者: lucadealfaro 项目源码 文件源码
def set_global(self, name, value):
        """Adds a global, or updates it if it already exists.

        Also removes the global from the list of unpicklable names.

        Args:
            name: the name of the global to remove
            value: any picklable value
        """
        blob = pickle.dumps(value, pickle.HIGHEST_PROTOCOL)

        if name in self.global_names:
            index = self.global_names.index(name)
            self.globals[index] = blob
        else:
            self.global_names.append(name)
            self.globals.append(blob)

        self.remove_unpicklable_name(name)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号