comparison @pyobject/methods.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 d1e00e614b4c
comparison
equal deleted inserted replaced
372:b20b8cf8ad07 373:0e4097c66788
77 if (nargout == 0) 77 if (nargout == 0)
78 if (isa (x, "py.types.ModuleType")) 78 if (isa (x, "py.types.ModuleType"))
79 modulename = char (pycall ("getattr", x, "__name__")); 79 modulename = char (pycall ("getattr", x, "__name__"));
80 printf ("Methods for Python module '%s':\n", modulename); 80 printf ("Methods for Python module '%s':\n", modulename);
81 else 81 else
82 ## FIXME: should be `class (x)` 82 printf ("Methods for Python class '%s':\n", __py_class_name__ (x));
83 classref = pycall ("getattr", x, "__class__");
84 classname = char (pycall ("getattr", classref, "__name__"));
85 printf ("Methods for Python class '%s':\n", classname);
86 endif 83 endif
87 disp (list_in_columns (mtds_list)); 84 disp (list_in_columns (mtds_list));
88 else 85 else
89 mtds = mtds_list(:); 86 mtds = mtds_list(:);
90 endif 87 endif