Mercurial > pytave
comparison @pyobject/pyobject.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 | b0677c492655 |
children | 5c900b8383c4 |
comparison
equal
deleted
inserted
replaced
364:1470ed26917a | 365:087e7bc3697f |
---|---|
75 | 75 |
76 __py_objstore_del__ (x.m_id); | 76 __py_objstore_del__ (x.m_id); |
77 endfunction | 77 endfunction |
78 | 78 |
79 # methods defined in external files | 79 # methods defined in external files |
80 char (x) | |
80 dummy (x) | 81 dummy (x) |
81 display (x) | 82 display (x) |
82 subsref (x, idx) | 83 subsref (x, idx) |
83 | 84 |
84 function r = id (x); | 85 function r = id (x); |
85 r = x.m_id; | 86 r = x.m_id; |
86 endfunction | |
87 | |
88 function s = char (x) | |
89 s = pycall ("str", x); | |
90 endfunction | 87 endfunction |
91 | 88 |
92 function varargout = disp (x) | 89 function varargout = disp (x) |
93 s = char (x); | 90 s = char (x); |
94 if (nargout == 0) | 91 if (nargout == 0) |