diff @pyobject/cell.m @ 365:087e7bc3697f

Do not automatically convert Python strings to Octave strings (fixes issue #65) * python_to_octave.cc (pytave::pyobj_to_octvalue): Drop conversion of bytes and unicode objects. * __py_struct_from_dict__.cc (F__py_string_value__): New function. * @pyobject/char.m: Define outside class definition, use __py_string_value__. * @pyobject/pyobject.m: Delete previous pyobject.char definition. * @pyobject/methods.m: Apply char conversion to __name__ attribute. * @py/py.m, @pyobject/cell.m, @pyobject/dummy.m, @pyobject/subsasgn.m, @pyobject/subsref.m, pyargs.m, pycall.cc, pyeval.cc: Adapt examples and tests to changes.
author Mike Miller <mtmiller@octave.org>
date Thu, 25 Aug 2016 14:06:56 -0700
parents 15c20ab4b80a
children 750a86973625
line wrap: on
line diff
--- a/@pyobject/cell.m	Thu Aug 25 12:11:02 2016 -0700
+++ b/@pyobject/cell.m	Thu Aug 25 14:06:56 2016 -0700
@@ -42,7 +42,9 @@
 ##     @{
 ##       [1,1] =  10
 ##       [1,2] =  20
-##       [1,3] = hello
+##             = [pyobject ...]
+##
+##                 hello
 ##     @}
 ## @end group
 ## @end example
@@ -84,7 +86,7 @@
 %!assert (cell (pyeval ("[1.]")), {1})
 %!assert (cell (pyeval ("[1., 2., 3.]")), {1, 2, 3})
 %!assert (cell (pyeval ("(1., 2., 3.)")), {1, 2, 3})
-%!assert (cell (pyobject ("asdf")), {"a", "s", "d", "f"})
+%!assert (cellfun (@char, cell (pyobject ("asdf")), "uniformoutput", false), {"a", "s", "d", "f"})
 
 %!test
 %! c = cell (pyeval ("range(10)"));