|
73 | 73 | SymbolSlot, |
74 | 74 | SymbolSqrt, |
75 | 75 | SymbolSubtract, |
76 | | - SymbolUndefined, |
77 | 76 | SymbolUnevaluated, |
78 | 77 | ) |
79 | 78 | from mathics.eval.tracing import trace_evaluate |
@@ -1111,7 +1110,7 @@ def rewrite_apply_eval_step(self, evaluation) -> Tuple[BaseElement, bool]: |
1111 | 1110 | assert self.elements_properties is not None |
1112 | 1111 |
|
1113 | 1112 | recompute_properties = False |
1114 | | - unevaluated_pairs: Dict[int, BaseElement] = {} |
| 1113 | + unevaluated_pairs: Dict[int, EvalMixin] = {} |
1115 | 1114 |
|
1116 | 1115 | # @timeit |
1117 | 1116 | def eval_elements(): |
@@ -1188,9 +1187,9 @@ def rest_range(indices: range): |
1188 | 1187 | # * evaluate elements, |
1189 | 1188 | # * run to_python() on them in Expression construction, or |
1190 | 1189 | # * convert Expression elements from a tuple to a list and back |
1191 | | - elements: Sequence[BaseElement] |
| 1190 | + elements: list = [] |
1192 | 1191 | if self.elements_properties.elements_fully_evaluated: |
1193 | | - elements = self._elements |
| 1192 | + elements = list(self._elements) |
1194 | 1193 | else: |
1195 | 1194 | elements = self.get_mutable_elements() |
1196 | 1195 | # FIXME: see if we can preserve elements properties in eval_elements() |
@@ -1221,7 +1220,7 @@ def rest_range(indices: range): |
1221 | 1220 | new = new.flatten_sequence(evaluation) |
1222 | 1221 | if new.elements_properties is None: |
1223 | 1222 | new._build_elements_properties() |
1224 | | - elements = new._elements |
| 1223 | + elements = list(new._elements) |
1225 | 1224 |
|
1226 | 1225 | def flatten_callback_for_Unevaluated(new_elements: tuple, i: int) -> list: |
1227 | 1226 | """If the Attribute ``Flat`` (flag ``A_FLAT``) is set, this |
|
0 commit comments