flattener.py 文件源码

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

项目:hatlog 作者: alehander42 项目源码 文件源码
def flatten_compare(self, node):
        if len(node.comparators) != 1:
            raise ValueError("hatlog supports only 1 comparator")
        if isinstance(node.ops[0], ast.Eq):
            op = 'z_eq'
        else:
            op = 'z_cmp'
        a = self.flatten(node.left)
        b = self.flatten(node.comparators[0])
        node_type = self.new_type()
        self.nodes.append((op, [a, b], node_type))
        return node_type
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号