sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.45k stars 481 forks source link

only one eq generate solve() error #32341

Open 094568f8-9190-4a26-9109-e1ea921ca772 opened 3 years ago

094568f8-9190-4a26-9109-e1ea921ca772 commented 3 years ago

The following code:

sage: a, b, c, d = SR.var('a, b, c, d', domain='real')
sage: solve([a == -d], [a, b, c, d])

should return:

[[a == -r4, b == r6, c == r5, d == r4]]

but instead gives the following error:

AttributeError: 'list' object has no attribute 'lhs'

CC: @slel

Component: symbolics

Keywords: solve

Issue created by migration from https://trac.sagemath.org/ticket/32341

094568f8-9190-4a26-9109-e1ea921ca772 commented 3 years ago

Description changed:

--- 
+++ 
@@ -1,3 +1,7 @@
+varL=var('a,b,c,d',domain='real')
+
+
+
 solve([a==-d],[a, b,c, d]) should have returned the following response

 [[a == -r4, b == r6, c == r5, d == r4]]
slel commented 3 years ago

Changed keywords from none to solve

slel commented 3 years ago

Description changed:

--- 
+++ 
@@ -1,11 +1,16 @@
-varL=var('a,b,c,d',domain='real')
+The following code:

+```
+sage: a, b, c, d = SR.var('a, b, c, d', domain='real')
+sage: solve([a == -d], [a, b, c, d])
+```
+should return:

+```
+[[a == -r4, b == r6, c == r5, d == r4]]
+```
+but instead gives the following error:

-solve([a==-d],[a, b,c, d]) should have returned the following response
-
-[[a == -r4, b == r6, c == r5, d == r4]]
-
-should not produce the following error: :
-
+```
 AttributeError: 'list' object has no attribute 'lhs'
+```