comparison @py/subsref.m @ 368:4d54fb68de71

__py_is_none__: new compiled function to test whether an object is None * __py_struct_from_dict__.cc (F__py_is_none__): New function. * @py/subsref.m, @pyobject/subsref.m, pycall.cc: Use __py_is_none__ instead of ad hoc lambda expression.
author Mike Miller <mtmiller@octave.org>
date Thu, 25 Aug 2016 16:27:46 -0700
parents 9d7188514f2c
children
comparison
equal deleted inserted replaced
367:9d7188514f2c 368:4d54fb68de71
63 if (isa (y, "py.collections.Callable")) 63 if (isa (y, "py.collections.Callable"))
64 y = pycall (y); 64 y = pycall (y);
65 endif 65 endif
66 endif 66 endif
67 67
68 is_none = pyeval ("lambda x: x is None"); 68 if (nargout > 0 || ! __py_is_none__ (y))
69 if (nargout > 0 || ! pycall (is_none, y))
70 varargout{1} = y; 69 varargout{1} = y;
71 endif 70 endif
72 71
73 endfunction 72 endfunction