Comment #6 on issue 1907 by asmeurer: Pow(..., evaluate=something) is broken http://code.google.com/p/sympy/issues/detail?id=1907
It think it's because Add cancels terms by creating a dictionary of term:coeff pairs. So, x + y - x becomes {x:1}, then {x:1, y:1}, and finally, {x:1 - 1, y: 1} == {x:0, y:1}. This is a good way to do it, because Python's dictionaries are very fast, but I guess it means that we need to ensure that equal items have the same hash.
On the other hand, if it really is something that would change with evaluation, then they aren't equal. What should Pow(2, 2, evaluate=True) - Pow(2, 2, evaluate=False) return? I think the best solution here is to do as
Mateusz is doing and have a separate class for unevaluated primitives. -- 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.
