changeset 314:6bba42371afa

Use tuple directly in subsref, avoiding fromPythonVarName * @pyobject/subsref.m: Replace fromPythonVarName.
author Colin Macdonald <cbm@m.fsf.org>
date Tue, 09 Aug 2016 15:15:57 -0700
parents 01ff03fef237
children 5b9c008c1d05
files @pyobject/subsref.m
diffstat 1 files changed, 3 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/@pyobject/subsref.m	Tue Aug 09 19:16:59 2016 -0700
+++ b/@pyobject/subsref.m	Tue Aug 09 15:15:57 2016 -0700
@@ -67,15 +67,9 @@
       elseif (isscalar (t.subs))
         ind = t.subs{1};
       else
-        ## XXX: after #26, #27, I think its just:
-        #ind = pycall ("tuple", t.subs);
-        pyexec (["global _temp\n" ...
-                 "def pystoretemp(x):\n" ...
-                 "    global _temp\n" ...
-                 "    _temp = x"]);
-        pycall ("pystoretemp", t.subs);
-        pyexec ("_temp = tuple(_temp[0])");
-        ind = pyobject.fromPythonVarName ("_temp");
+        ## workaround bug: we get list of list instead of list
+        # ind = pycall ("tuple", t.subs);
+        ind = pycall (pyeval ("lambda x: tuple(x[0])"), t.subs);
       endif
 
       gi = pycall ("getattr", x, "__getitem__");   # x.__getitem__