From 1666cd9242cc659e889aa71bde3393ee04666228 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner <inform@tiker.net> Date: Sat, 25 Oct 2014 21:23:06 -0500 Subject: [PATCH] Make make_sym_{vector,array} usable even without subscript-by-getitem --- pymbolic/primitives.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pymbolic/primitives.py b/pymbolic/primitives.py index 4be517c..660aed6 100644 --- a/pymbolic/primitives.py +++ b/pymbolic/primitives.py @@ -1563,7 +1563,7 @@ def make_sym_vector(name, components): from pytools.obj_array import join_fields vfld = Variable(name) - return join_fields(*[vfld[i] for i in components]) + return join_fields(*[vfld.index(i) for i in components]) def make_sym_array(name, shape): @@ -1575,7 +1575,7 @@ def make_sym_array(name, shape): result = np.zeros(shape, dtype=object) from pytools import indices_in_shape for i in indices_in_shape(shape): - result[i] = vfld[i] + result[i] = vfld.index(i) return result -- GitLab