From e8c5cb55cbce5a85bf051ccf68c24c111bf03f38 Mon Sep 17 00:00:00 2001 From: Chris Ballance Date: Wed, 29 Mar 2017 14:33:29 +0100 Subject: [PATCH] language: fix PYONValue list defaults (fixes #682) --- artiq/language/environment.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/artiq/language/environment.py b/artiq/language/environment.py index 779d74fb8..a0d462e9c 100644 --- a/artiq/language/environment.py +++ b/artiq/language/environment.py @@ -48,6 +48,12 @@ class _SimpleArgProcessor: class PYONValue(_SimpleArgProcessor): """An argument that can be any PYON-serializable value.""" + def __init__(self, default=NoDefault): + # Override the _SimpleArgProcessor init, as list defaults are valid + # PYON values + if default is not NoDefault: + self.default_value = default + def process(self, x): return pyon.decode(x)