# HG changeset patch # User Abhinav Tripathi # Date 1470208940 25200 # Node ID 49832ca978fdf7be82ff01612ca0c91117be7984 # Parent f5282c87e5d5e8f72c197db5001ceae27fc2df0d Use new subsref indexing to fix the failing tests * @pyobject/methods.m, @pyobject/fieldnames.m: Use the new subsref indexing to convert the pyobject to octave cell before returning diff -r f5282c87e5d5 -r 49832ca978fd @pyobject/fieldnames.m --- a/@pyobject/fieldnames.m Wed Aug 03 00:18:40 2016 -0700 +++ b/@pyobject/fieldnames.m Wed Aug 03 00:22:20 2016 -0700 @@ -52,8 +52,10 @@ " and not isinstance(getattr(x, a), __import__('types').ModuleType)" ... " and not a.startswith('_')]"]); - # FIXME: may need to convert from Python list to Octave cell array - names = pycall (cmd, x); + names_obj = pycall (cmd, x); + len = length (names_obj); + idx = struct ("type", "{}", "subs", {{1:len}}); + [names{1:len}] = subsref (names_obj, idx); names = names(:); endfunction diff -r f5282c87e5d5 -r 49832ca978fd @pyobject/methods.m --- a/@pyobject/methods.m Wed Aug 03 00:18:40 2016 -0700 +++ b/@pyobject/methods.m Wed Aug 03 00:22:20 2016 -0700 @@ -71,8 +71,10 @@ cmd = pyeval (["lambda x: [a for a in dir(x)" ... " if callable(getattr(x, a)) and not a.startswith('_')]"]); - # FIXME: may need to convert from Python list to Octave cell array - mtds_list = pycall (cmd, x) + mtds_list_obj = pycall (cmd, x); + len = length (mtds_list_obj); + idx = struct ("type", "{}", "subs", {{1:len}}); + [mtds_list{1:len}] = subsref (mtds_list_obj, idx); if (nargout == 0) ## FIXME: should this be available as @pyobject/ismodule.m ?