expressions.py 文件源码

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

项目:jx-sqlite 作者: mozilla 项目源码 文件源码
def __new__(cls, op, terms):
        if isinstance(terms, list):
            return object.__new__(cls, op, terms)

        items = terms.items()
        if len(items) == 1:
            if isinstance(items[0][1], list):
                return InOp("in", items[0])
            else:
                return EqOp("eq", items[0])
        else:
            acc = []
            for lhs, rhs in items:
                if rhs.json.startswith("["):
                    acc.append(InOp("in", [Variable(lhs), rhs]))
                else:
                    acc.append(EqOp("eq", [Variable(lhs), rhs]))
            return AndOp("and", acc)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号