gnu-octave / symbolic

A Symbolic Package for Octave using SymPy
https://octave.sourceforge.io/symbolic/
GNU General Public License v3.0
158 stars 36 forks source link

Regression caused by cd263b3853482226dbffe99486ff98c8445d6a63 #1151

Closed alexvong243f closed 2 years ago

alexvong243f commented 2 years ago

I realize cd263b3853482226dbffe99486ff98c8445d6a63 causes a regression because in the following code:

     elseif (isequal (x, []))
      var_pyobj.append (py.list ());

If x is '', we have isequal ('', []) being evaluated to true which is not what we want.

See also the discussion in #1136.

cbm755 commented 2 years ago

Is there a particular thing that fails b/c of this? Something like a = pycall_sympy__('return _ins[0]', "")? Or sym('')?

Must be something missing from the test suite anyway: so when we fix this we should add something to the BIST.

alexvong243f commented 2 years ago

Due to this bug,

pycall_sympy__ ('sys.stderr.write(repr(_ins[0]) + "\n")', '');

prints [] rather than ''.

Basically, the empty string turns into the empty list in Python, which is incorrect and different from the old behaviour.