utils.py 文件源码

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

项目:Scalable-PaQL-Queries 作者: mattfeel 项目源码 文件源码
def opstr_to_op(opstr):
    if opstr == "<=":
        return operator.le
    elif opstr == ">=":
        return operator.ge
    elif opstr == "<":
        return operator.lt
    elif opstr == ">":
        return operator.gt
    elif opstr == "=":
        return operator.eq
    elif opstr == "-":
        return operator.sub
    elif opstr == "+":
        return operator.add
    elif opstr == "/":
        return operator.div
    elif opstr == "*":
        return operator.mul
    elif opstr == "and":
        return operator.and_
    elif opstr == "or":
        return operator.or_
    elif opstr == "not":
        return operator.not_
    else:
        raise Exception("Opstr not supported: {}".format(opstr))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号