摘要: 问题 用法 配合递归使用,遍历树形结构比较方便 E.g: def parse(tree): global count count += 1 for subtree in tree: label = subtree.label() if label == 'OrderBy': print(f"###: 阅读全文
posted @ 2021-10-13 20:37 春树&暮云 阅读(20) 评论(0) 推荐(0) 编辑
摘要: 问题 字典中包含非字典的子对象的序列化 方式1 使用default参数,default=lambda obj: obj.__dict__(), 保证其中包含的非字典对象的类有方法__dict__ class ID(object): def __init__(self, id) -> None: se 阅读全文
posted @ 2021-10-13 18:52 春树&暮云 阅读(123) 评论(0) 推荐(0) 编辑