예제 #1
0
파일: typeannotate.py 프로젝트: Muon/redux
    def visit_BinaryOp(self, binop):
        binop = self.generic_visit(binop)

        if is_numeric(binop.lhs.type) and is_numeric(binop.rhs.type):
            binop.type = common_arithmetic_type(binop.lhs.type, binop.rhs.type)
        else:
            raise InvalidExpressionError(binop)

        return binop
예제 #2
0
파일: intrinsics.py 프로젝트: Muon/redux
 def type(self, args):
     return common_arithmetic_type(args[0].type, args[1].type)