forked from M-Labs/artiq
1
0
Fork 0

transform/tools/value_to_ast: support floats

This commit is contained in:
Sebastien Bourdeauducq 2014-09-16 23:11:53 +08:00
parent f061b15994
commit dc38356ad9
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ def value_to_ast(value):
func=ast.Name("int64", ast.Load()),
args=[ast.Num(int(value))],
keywords=[], starargs=None, kwargs=None)
elif isinstance(value, int):
elif isinstance(value, (int, float)):
return ast.Num(value)
elif isinstance(value, Fraction):
return ast.Call(