def ivy_type_of_lit(self, x):
ast_class = parse_literal_expression(x)
if ast_class is ast.Num:
return 't_intbool'
elif ast_class is ast.Str:
return 't_str'
elif ast_class is ast.NameConstant and x in ['True', 'False']:
return 't_intbool'
elif ast_class is ast.NameConstant and x == 'None':
return 't_none'
else:
return None
评论列表
文章目录