|
|
@ -18,14 +18,20 @@ class Return(Operation): |
|
|
|
else: |
|
|
|
else: |
|
|
|
values = [values] |
|
|
|
values = [values] |
|
|
|
else: |
|
|
|
else: |
|
|
|
for value in values: |
|
|
|
self._valid_value(values) |
|
|
|
assert is_valid_rvalue(value) or isinstance(value, TupleVariable) |
|
|
|
|
|
|
|
super(Return, self).__init__() |
|
|
|
super(Return, self).__init__() |
|
|
|
self._values = values |
|
|
|
self._values = values |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _valid_value(self, value): |
|
|
|
|
|
|
|
if isinstance(value, list): |
|
|
|
|
|
|
|
assert all(self._valid_value(v) for v in value) |
|
|
|
|
|
|
|
else: |
|
|
|
|
|
|
|
assert is_valid_rvalue(value) or isinstance(value, TupleVariable) |
|
|
|
|
|
|
|
return True |
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
|
@property |
|
|
|
def read(self): |
|
|
|
def read(self): |
|
|
|
return self.values |
|
|
|
return self._unroll(self.values) |
|
|
|
|
|
|
|
|
|
|
|
@property |
|
|
|
@property |
|
|
|
def values(self): |
|
|
|
def values(self): |
|
|
|