class Bunch(dict):
def __init__(self, *args, **kwds):
super(Bunch, self),__init__(*args, **kwds)
self.__dict__ = self
Bunch设计模式
最新推荐文章于 2025-10-24 15:59:33 发布
本文介绍了一个名为 Bunch 的 Python 类定义,该类继承自 dict 并对其进行了扩展,使得可以通过属性方式访问字典项。

72

被折叠的 条评论
为什么被折叠?



