# HG changeset patch
# User Punarbasu Purkayastha <ppurka@gmail.com>
# Date 1343733499 28800
# Node ID bd88c770c7296f94dfa8d610379fcae6751c9a56
# Parent 79d77c717499ade7a62afcdc1efedf0f4b1112e1
Take care of cases like solve([x4], [x]) for consistency with multivariable input
diff git a/sage/symbolic/expression.pyx b/sage/symbolic/expression.pyx
a

b


8283  8283  
8284  8284  TESTS: 
8285  8285  
8286   Trac #7325 (solving inequalities):: 
 8286  :trac:`7325` (solving inequalities):: 
8287  8287  
8288  8288  sage: (x^2>1).solve(x) 
8289  8289  [[x < 1], [x > 1]] 
… 
… 

8298  8298  sage: solve(acot(x),x,to_poly_solve=True) 
8299  8299  [] 
8300  8300  
8301   Trac #7491 fixed:: 
 8301  :trac:`7491` fixed:: 
8302  8302  
8303  8303  sage: y=var('y') 
8304  8304  sage: solve(y==y,y) 
8305  8305  [y == r1] 
8306  8306  sage: solve(y==y,y,multiplicities=True) 
8307  8307  ([y == r1], []) 
8308   
 8308  
8309  8309  sage: from sage.symbolic.assumptions import GenericDeclaration 
8310  8310  sage: GenericDeclaration(x, 'rational').assume() 
8311  8311  sage: solve(x^2 == 2, x) 
8312  8312  [] 
8313  8313  sage: forget() 
8314  8314  
8315   Trac #8390 fixed:: 
 8315  :trac:`8390` fixed:: 
8316  8316  
8317  8317  sage: solve(sin(x)==1/2,x) 
8318  8318  [x == 1/6*pi] 
… 
… 

8327  8327  sage: solve(sin(x)==1/2,x,to_poly_solve='force') 
8328  8328  [x == 5/6*pi + 2*pi*z116, x == 1/6*pi + 2*pi*z114] 
8329  8329  
8330   Trac #11618 fixed:: 
 8330  :trac:`11618` fixed:: 
8331  8331  
8332  8332  sage: g(x)=0 
8333  8333  sage: solve(g(x)==0,x,solution_dict=True) 
8334  8334  [{x: r1}] 
 8335  
 8336  :trac:`13286` fixed:: 
 8337  
 8338  sage: solve([x4], [x]) 
 8339  [x == 4] 
8335  8340  """ 
8336  8341  import operator 
8337  8342  cdef Expression ex 
… 
… 

8353  8358  if multiplicities and to_poly_solve: 
8354  8359  raise NotImplementedError, "to_poly_solve does not return multiplicities" 
8355  8360  
 8361  # Take care of cases like solve([x^21], [x]) for consistency with 
 8362  # multiple variable input in sage.symbolic.relation.solve(). 
 8363  # There *should* be only one variable in the list, since it is 
 8364  # passed from sage.symbolic.relation.solve() and multiple variables 
 8365  # there don't call this function. 
 8366  if isinstance(x, (list, tuple)): 
 8367  x = x[0] 
 8368  
8356  8369  if x is None: 
8357  8370  v = ex.variables() 
8358  8371  if len(v) == 0: 