forked from M-Labs/artiq
1
0
Fork 0

language: fix PYONValue list defaults (fixes #682)

This commit is contained in:
Chris Ballance 2017-03-29 14:33:29 +01:00 committed by Sébastien Bourdeauducq
parent d04d7ed120
commit 756e8a415e
1 changed files with 6 additions and 0 deletions

View File

@ -49,6 +49,12 @@ class _SimpleArgProcessor:
class PYONValue(_SimpleArgProcessor): class PYONValue(_SimpleArgProcessor):
"""An argument that can be any PYON-serializable value.""" """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): def process(self, x):
return pyon.decode(x) return pyon.decode(x)