changeset 281:b06df69f4b37

Remove unused code and add tests to pycall * pycall.cc: Cleanup unused code and add tests to verify conversion of lists, dicts and tuples to pyobject
author Abhinav Tripathi <genuinelucifer@gmail.com>
date Sun, 31 Jul 2016 12:29:15 -0700
parents 3bf799e80ca5
children 46d9b2972901
files pycall.cc
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pycall.cc	Fri Jul 29 20:15:39 2016 -0700
+++ b/pycall.cc	Sun Jul 31 12:29:15 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