2
0
mirror of https://github.com/m-labs/artiq.git synced 2024-12-28 20:53:35 +08:00

language/core: add array function

This commit is contained in:
Sebastien Bourdeauducq 2014-09-09 17:12:37 +08:00
parent 1bf2142785
commit f410b4d241

View File

@ -1,5 +1,6 @@
from collections import namedtuple
from fractions import Fraction
from copy import copy
from artiq.language import units
@ -35,6 +36,10 @@ def round64(x):
return int64(round(x))
def array(element, count):
return [copy(element) for i in range(count)]
def _make_kernel_ro(value):
return isinstance(
value, (bool, int, int64, float, Fraction, units.Quantity))