Comment #4 on issue 2566 by [email protected]: Equating Sums shouldn't depend on dummy variables
http://code.google.com/p/sympy/issues/detail?id=2566

I'm increasingly against converting Symbols to Dummys internally. This makes it impossible to do substitutions on the arguments. For example, Lambda, which does do this (issue 2442):

In [84]: Lambda(y, 2*y).subs(y, x)
Out[84]: Λ(y, 2⋅y)

In [85]: Lambda(y, 2*y).subs(y, 1/y)
Out[85]: Λ(y, 2⋅y)

In [86]: Lambda(y, 2*y).xreplace({y, 1/y})
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/Users/aaronmeurer/Documents/Python/sympy/sympy/<ipython-input-86-da62efdbaba9> in <module>()
----> 1 Lambda(y, 2*y).xreplace({y, 1/y})

/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/basic.py in xreplace(self, rule)
    899
    900     @deprecated
--> 901     def __contains__(self, obj):
    902         if self == obj:
    903             return True

/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/basic.py in xreplace(self, rule)
    899
    900     @deprecated
--> 901     def __contains__(self, obj):
    902         if self == obj:
    903             return True

/Users/aaronmeurer/Documents/Python/sympy/sympy/sympy/core/basic.py in xreplace(self, rule)
   1343
   1344     @deprecated
-> 1345     def __contains__(self, obj):
   1346         return (self == obj)
   1347

AttributeError: 'set' object has no attribute 'get'

The only way to change it is to manually rewrite the Lambda. See also issue 2571, which has real life examples of why this sort of thing would be useful for Integral.

--
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