Opened 4 years ago

Closed 2 months ago

solve(x, [x], solution_dict=True) error

Reported by: Owned by: rws major sage-duplicate/invalid/wontfix calculus charpent N/A

```solve(x, [x], solution_dict=True)
...
/home/ralf/sage/local/lib/python2.7/site-packages/sage/symbolic/relation.pyc in solve(f, *args, **kwds)
1045
1046     if is_Expression(f): # f is a single expression
-> 1047         return _solve_expression(f, x, explicit_solutions, multiplicities, to_poly_solve, solution_dict, algorithm, domain)
1048
1049     if not isinstance(f, (list, tuple)):

/home/ralf/sage/local/lib/python2.7/site-packages/sage/symbolic/relation.pyc in _solve_expression(f, x, explicit_solutions, multiplicities, to_poly_solve, solution_dict, algorithm, domain)
1369     if solution_dict:
1370         if isinstance(x, (list, tuple)):
-> 1371             X = [{sol.left():sol.right() for sol in b} for b in X]
1372         else:
1373             X = [dict([[sol.left(),sol.right()]]) for sol in X]

TypeError: 'sage.symbolic.expression.Expression' object is not iterable
```

comment:1 Changed 4 years ago by rws

• Description modified (diff)

comment:2 Changed 4 years ago by charpent

• Cc charpent added

comment:3 follow-up: ↓ 4 Changed 2 months ago by chapoton

• Milestone changed from sage-8.2 to sage-duplicate/invalid/wontfix
• Status changed from new to needs_review

fixed by #31452, so duplicate, please confirm

comment:4 in reply to: ↑ 3 ; follow-up: ↓ 5 Changed 2 months ago by charpent

• Milestone changed from sage-duplicate/invalid/wontfix to sage-9.4
• Status changed from needs_review to needs_work

fixed by #31452, so duplicate, please confirm

Nope. On 9.3 :

```sage: solve(x, [x], solution_dict=True)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-6f16dd325c63> in <module>
----> 1 solve(x, [x], solution_dict=True)

/usr/local/sage-9/local/lib/python3.9/site-packages/sage/symbolic/relation.py in solve(f, *args, **kwds)
1041
1042     if is_Expression(f): # f is a single expression
-> 1043         return _solve_expression(f, x, explicit_solutions, multiplicities, to_poly_solve, solution_dict, algorithm, domain)
1044
1045     if not isinstance(f, (list, tuple)):

/usr/local/sage-9/local/lib/python3.9/site-packages/sage/symbolic/relation.py in _solve_expression(f, x, explicit_solutions, multiplicities, to_poly_solve, solution_dict, algorithm, domain)
1366     if solution_dict:
1367         if isinstance(x, (list, tuple)):
-> 1368             X = [{sol.left():sol.right() for sol in b} for b in X]
1369         else:
1370             X = [dict([[sol.left(),sol.right()]]) for sol in X]

/usr/local/sage-9/local/lib/python3.9/site-packages/sage/symbolic/relation.py in <listcomp>(.0)
1366     if solution_dict:
1367         if isinstance(x, (list, tuple)):
-> 1368             X = [{sol.left():sol.right() for sol in b} for b in X]
1369         else:
1370             X = [dict([[sol.left(),sol.right()]]) for sol in X]

TypeError: 'sage.symbolic.expression.Expression' object is not iterable
```

==> `needs_work`, and relevant milestone.

comment:5 in reply to: ↑ 4 Changed 2 months ago by charpent

• Milestone changed from sage-9.4 to sage-duplicate/invalid/wontfix
• Status changed from needs_work to needs_review

Wups : #31452 in NOT in 9.3 (I should wear my spectacles when reading `trac`...).

I'll test this. Restoring status...

Apologies.

fixed by #31452, so duplicate, please confirm

Nope. On 9.3 :

```sage: solve(x, [x], solution_dict=True)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-6f16dd325c63> in <module>
----> 1 solve(x, [x], solution_dict=True)

/usr/local/sage-9/local/lib/python3.9/site-packages/sage/symbolic/relation.py in solve(f, *args, **kwds)
1041
1042     if is_Expression(f): # f is a single expression
-> 1043         return _solve_expression(f, x, explicit_solutions, multiplicities, to_poly_solve, solution_dict, algorithm, domain)
1044
1045     if not isinstance(f, (list, tuple)):

/usr/local/sage-9/local/lib/python3.9/site-packages/sage/symbolic/relation.py in _solve_expression(f, x, explicit_solutions, multiplicities, to_poly_solve, solution_dict, algorithm, domain)
1366     if solution_dict:
1367         if isinstance(x, (list, tuple)):
-> 1368             X = [{sol.left():sol.right() for sol in b} for b in X]
1369         else:
1370             X = [dict([[sol.left(),sol.right()]]) for sol in X]

/usr/local/sage-9/local/lib/python3.9/site-packages/sage/symbolic/relation.py in <listcomp>(.0)
1366     if solution_dict:
1367         if isinstance(x, (list, tuple)):
-> 1368             X = [{sol.left():sol.right() for sol in b} for b in X]
1369         else:
1370             X = [dict([[sol.left(),sol.right()]]) for sol in X]

TypeError: 'sage.symbolic.expression.Expression' object is not iterable
```

==> `needs_work`, and relevant milestone.

comment:6 Changed 2 months ago by charpent

• Milestone changed from sage-duplicate/invalid/wontfix to sage-9.4
• Status changed from needs_review to positive_review

Rebased on 9.3, {{{ptestlong}} of your branch gimes me exactly the same failures (two `gap`-related permanent failures and one transient `pari-gp` timeout) as 9.3.

==> `positive_review` (for good, this time (I hope...)).

comment:7 Changed 2 months ago by charpent

• Milestone changed from sage-9.4 to sage-duplicate/invalid/wontfix

I'm stupid : I positioned `positive_review` on a `duplicate` ticket. Fixed. Time for a walk...

comment:8 Changed 2 months ago by chapoton

• Resolution set to duplicate
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.