diff @pyobject/pyobject.m @ 373:0e4097c66788

Report a Python object's fully qualified class name correctly * oct-py-util.cc (pytave::py_object_class_name): Return the correct fully qualified class name, including module prefix. (pytave::is_py_kwargs_argument): Check for class name "__main__._OctaveKwargs". * __py_struct_from_dict__.cc (F__py_class_name__): New function. * @pyobject/methods.m (pyobject.methods): Use __py_class_name__. * @pyobject/pyobject.m (pyobject.class): Likewise.
author Mike Miller <mtmiller@octave.org>
date Fri, 26 Aug 2016 14:05:37 -0700
parents 9d7188514f2c
children d362cdd1ddeb
line wrap: on
line diff
--- a/@pyobject/pyobject.m	Fri Aug 26 13:59:18 2016 -0700
+++ b/@pyobject/pyobject.m	Fri Aug 26 14:05:37 2016 -0700
@@ -96,11 +96,8 @@
     endfunction
 
     function s = class (x)
-      idx = struct ("type", ".", "subs", "__class__");
-      class_ref = subsref (x, idx);
-      idx = struct ("type", ".", "subs", "__name__");
-      s = subsref (class_ref, idx);
-      s = sprintf ("py.%s", char (s));
+      s = __py_class_name__ (x);
+      s = sprintf ("py.%s", s);
     endfunction
 
     function y = double (x)