Skip to content

Commit

Permalink
private/store_vars_in_python: Fixes regression...
Browse files Browse the repository at this point in the history
...caused by cd263b3.

Closes gnu-octave#1151.

* inst/private/store_vars_in_python.m: Update it.
* inst/pycall_sympy__.m: Add test accordingly.
  • Loading branch information
Alex Vong authored and Alex Vong committed Jun 25, 2022
1 parent 280ad32 commit aba48eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion inst/private/store_vars_in_python.m
Expand Up @@ -26,7 +26,7 @@
var_pyobj.append (pyeval (sympy (x)))
elseif (iscell (x))
var_pyobj.append (store_vars_in_python (x))
elseif (isequal (x, []))
elseif (isnumeric (x) && isequal (x, [])) % See #1151 for more details
var_pyobj.append (py.list ());
else
var_pyobj.append(x);
Expand Down
4 changes: 4 additions & 0 deletions inst/pycall_sympy__.m
Expand Up @@ -481,3 +481,7 @@
%! % ensure the 0x0 matrix in octave gets mapped to the empty list in python
%! % @sym/subsasgn currently replies on this behaviour
%! assert (pycall_sympy__ ('return _ins[0] == []', []));

%!test
%! % ensure the empty string gets mapped to the empty string in python
%! assert (pycall_sympy__ ('return _ins[0] == ""', ''));

0 comments on commit aba48eb

Please sign in to comment.