Mercurial > pytave
diff pycall.cc @ 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 | 087e7bc3697f |
children | 55cd61fe519a |
line wrap: on
line diff
--- a/pycall.cc Thu Aug 25 15:26:32 2016 -0700 +++ b/pycall.cc Thu Aug 25 16:27:46 2016 -0700 @@ -278,8 +278,7 @@ %!test %! f = pyeval ("lambda: None"); %! r = pycall (f); -%! is_none = pyeval ("lambda x: x is None"); -%! assert (is_none (r)) +%! assert (__py_is_none__ (r)) ## But returning None will not set "ans" %!test