changeset 283:46d9b2972901

Merged in macdonald/pytave (pull request #27) Make pyobject callable by users (to convert input)
author Mike Miller <mike@mtmxr.com>
date Tue, 02 Aug 2016 12:04:12 -0700
parents b06df69f4b37 (diff) 4c4747646e12 (current diff)
children 9e8faa439d1d
files
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pycall.cc	Thu Jul 28 10:55:44 2016 -0700
+++ b/pycall.cc	Tue Aug 02 12:04:12 2016 -0700
@@ -203,11 +203,6 @@
           break;
         }
 
-      object hex_function = builtins_module.attr ("hex");
-      object id_function = builtins_module.attr ("id");
-      object idtmp = hex_function (id_function (res));
-      id = extract<std::string> (idtmp);
-
       // Ensure reasonable "ans" behaviour, consistent with Python's "_".
       if (nargout > 0 || ! res.is_none ())
         {
@@ -242,6 +237,9 @@
 %!assert (pycall ("cmath.sqrt", 2j), sqrt (2j))
 %!assert (pycall ("int", 10.2), 10)
 %!assert (isa (pycall ("object"), "pyobject"))
+%!assert (isa (pycall ("dict"), "pyobject"))
+%!assert (isa (pycall ("list"), "pyobject"))
+%!assert (isa (pycall ("tuple"), "pyobject"))
 
 ## Test argument type conversion of values into Python
 %!test