Mercurial > pytave
comparison octave_to_python.cc @ 183:2b03585d4ddd
Add proper conversion of booleans between octave and python. (fixes issue #6)
* octave_to_python.cc (octvalue_to_pyobj): Allow conversion if the octvalue is
boolean.
* python_to_octave.cc (pyobj_to_octvalue): Check and convert booleans from
python to octave.
* pycall.cc, pyeval.cc: Add the respective tests for boolean conversion.
author | Abhinav Tripathi <genuinelucifer@gmail.com> |
---|---|
date | Sat, 04 Jun 2016 13:30:01 -0700 |
parents | f31a5f5b5269 |
children | cede17a86ccf |
comparison
equal
deleted
inserted
replaced
182:0bf4b7cf16ee | 183:2b03585d4ddd |
---|---|
215 { | 215 { |
216 if (octvalue.is_undefined ()) | 216 if (octvalue.is_undefined ()) |
217 throw value_convert_exception ( | 217 throw value_convert_exception ( |
218 "Octave value `undefined'. Can not convert to a Python object"); | 218 "Octave value `undefined'. Can not convert to a Python object"); |
219 else if (octvalue.is_numeric_type () || octvalue.is_string () | 219 else if (octvalue.is_numeric_type () || octvalue.is_string () |
220 || octvalue.is_cell ()) | 220 || octvalue.is_cell () || octvalue.is_bool_type ()) |
221 octvalue_to_pyarr (py_object, octvalue); | 221 octvalue_to_pyarr (py_object, octvalue); |
222 else if (octvalue.is_map ()) | 222 else if (octvalue.is_map ()) |
223 octmap_to_pyobject (py_object, octvalue.map_value ()); | 223 octmap_to_pyobject (py_object, octvalue.map_value ()); |
224 else | 224 else |
225 throw value_convert_exception ( | 225 throw value_convert_exception ( |