From dc38356ad9f38eb39f0a74f13cb44d1cda1c5063 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 16 Sep 2014 23:11:53 +0800 Subject: [PATCH] transform/tools/value_to_ast: support floats --- artiq/transforms/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/artiq/transforms/tools.py b/artiq/transforms/tools.py index ae3942114..b5fb5d547 100644 --- a/artiq/transforms/tools.py +++ b/artiq/transforms/tools.py @@ -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(