Opened 3 years ago

Last modified 3 years ago

#24255 new defect

Fix constants coercion into SR — at Version 2

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:

Status badges

Description (last modified by rws)

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)
sage: (x*pi).subs({x*pi:e})

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

The problem is that constants are not made into expressions immediately:

sage: SR(e)
sage: type(_)
<type 'sage.symbolic.constants_c.E'>
sage: e+1-1
sage: type(_)
<type 'sage.symbolic.expression.Expression'>
sage: x*pi==e+1-1
pi*x == e

Change History (2)

comment:1 Changed 3 years ago by rws

  • Description modified (diff)

comment:2 Changed 3 years ago by rws

  • Description modified (diff)
  • Summary changed from Fix substitution with pattern given as equation to Fix constants coercion into SR
Note: See TracTickets for help on using tickets.