# HG changeset patch # User Colin Macdonald # Date 1470780957 25200 # Node ID 6bba42371afabc5715565cfb758e68cc8aebfb7a # Parent 01ff03fef23721bdcedc29dc459809e71407453e Use tuple directly in subsref, avoiding fromPythonVarName * @pyobject/subsref.m: Replace fromPythonVarName. diff -r 01ff03fef237 -r 6bba42371afa @pyobject/subsref.m --- 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__