Opened 3 years ago
Last modified 3 years ago
#24255 new defect
Fix Expression subclasses coercion into SR — at Version 4
Reported by: | rws | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.2 |
Component: | symbolics | Keywords: | |
Cc: | Merged in: | ||
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
There is a long-standing problem with substitution in that some substitutions do not work when given as equality but do work when given as dictionary.
sage: (x*pi).subs(x*pi==e) x*pi sage: (x*pi).subs({x*pi:e}) e sage: s = x.series(x,2); s 1*x + Order(x^2)
It looks like that in some cases the conversion to dict switches lhs and rhs of the equation and this is because of such behaviour:
sage: x*pi==e e == pi*x sage: x == s 1*x + Order(x^2) == x
The problem is that constants/series are subclasses of Expression
and are not coerced/converted immediately into Expression
:
sage: SR(e) e sage: type(_) <type 'sage.symbolic.constants_c.E'> sage: e+1-1 e sage: type(_) <type 'sage.symbolic.expression.Expression'>
Change History (4)
comment:1 Changed 3 years ago by
- Description modified (diff)
comment:2 Changed 3 years ago by
- Description modified (diff)
- Summary changed from Fix substitution with pattern given as equation to Fix constants coercion into SR
comment:3 Changed 3 years ago by
- Description modified (diff)
- Summary changed from Fix constants coercion into SR to Fix constant e coercion into SR
comment:4 Changed 3 years ago by
- Description modified (diff)
- Summary changed from Fix constant e coercion into SR to Fix Expression subclasses coercion into SR
Note: See
TracTickets for help on using
tickets.