Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve: Normalize Input (f, *symbols...) #11653

Open
latot opened this issue Sep 26, 2016 · 1 comment
Open

Solve: Normalize Input (f, *symbols...) #11653

latot opened this issue Sep 26, 2016 · 1 comment

Comments

@latot
Copy link
Contributor

latot commented Sep 26, 2016

Hi, i think this should be normalized, if we have only eqs we can pass symbols as a list, but if it have a ineq we get an error:

>>> solve((y>1), [x])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.7/site-packages/sympy/solvers/solvers.py", line 830, in solve
    return reduce_inequalities(f, symbols=symbols)
  File "/usr/lib64/python2.7/site-packages/sympy/solvers/inequalities.py", line 664, in reduce_inequalities
    symbols = (set(symbols) or gens) & gens
TypeError: unhashable type: 'list'

>>> solve([Eq(x+y, 1), Eq(x-y, 1)], [x, y])
{x: 1, y: 0}

Thx. Cya.

@oscarbenjamin
Copy link
Collaborator

This now gives

In [14]: solve((y>1), [x])
Out[14]: 1 < y  y <

I don't know whether I think that's reasonable or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants