What you need to consider is if Eq is really an iterable container or not. You can always convert it to one--or indeed, any Basic object into one--using .args. It's also straight forward enough to combine this with list comprehensions for functions like zip().
Personally, I don't think it is, but what exactly Relationals are and aren't is ambiguous (c.f. issue 1887). Aaron Meurer On Jun 1, 2012, at 4:01 PM, "[email protected]" <[email protected]> wrote: > What about making Eq iterable? It will permit the use of zip on a list of Eq. > > On 1 June 2012 20:48, Aaron Meurer <[email protected]> wrote: >> I thought this too, but the consensus was to make it not do it. For >> example, what would (x + y).subs(Eq(x, y)) return? See >> http://code.google.com/p/sympy/issues/detail?id=2677. >> >> Aaron Meurer >> >> On Wed, May 30, 2012 at 10:36 AM, [email protected] >> <[email protected]> wrote: >>> Do you agree? It would be useful for: >>> >>> In [10]: x.subs(Eq(x,1)) >>> --------------------------------------------------------------------------- >>> ValueError: >>> When a single argument is passed to subs it should be an iterable of >>> (old, new) tuples. >>> >>> In [11]: x.subs([Eq(x,1)]) >>> --------------------------------------------------------------------------- >>> TypeError: 'Equality' object is not iterable >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "sympy" 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?hl=en. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "sympy" 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?hl=en. >> > > -- > You received this message because you are subscribed to the Google Groups > "sympy" 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?hl=en. > -- You received this message because you are subscribed to the Google Groups "sympy" 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?hl=en.
