Status: Accepted
Owner: ----
Labels: Type-Defect Priority-Medium Milestone-Release0.7.0

New issue 1520 by [email protected]: Inconsistency in subs
http://code.google.com/p/sympy/issues/detail?id=1520


I think I found some inconsistencies in the behavior of .subs. For example,
why doesn't the following return 1/2

  In [1]: x.subs(2*x, 1)
Out[1]: x

but then:

In [2]: (y*x).subs(2*x, 1)
Out[2]:
y
-
2


Also, why this last does match, but not

In [4]: (x*y).subs(z*x, 1)
Out[4]: x*y

? (answer should be y/z in case we agree to match non-existant symbols)

The reason seems to be that we have not a clear policy on how strict
matching should be.


What do other systems do?
----------------------

Mathematica, for example, does not match non-existant symbols:

In[5]:= x y /.  2 x -> 2

Out[5]= x y



--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to