Re: [sympy] allowing Eq as recognized subs argument?

2024-03-28 Thread Aaron Meurer
I remember this being proposed a long time ago, and there being a
pretty extensive discussion about it. We should definitely look at
what was said in those previous discussions before proceeding with
this, because I think it was intentionally decided not to support
this, if I remember the outcome correctly.

Aaron Meurer

On Wed, Mar 27, 2024 at 5:36 PM Chris Smith  wrote:
>
> In https://github.com/sympy/sympy/pull/26399 there is proposal to allow 
> `subs` to recognize `Eq` so ` x.subs(x, 1) = x.subs( Eq(x, 1) ) = x.subs( [ 
> Eq(x, 1) ] ) = 1` but `x.subs(Eq(1, x)) = x`.
>
> It would be good to see if there is any strong senitment and rationale for or 
> against this.
>
> In favor, `Eq` is an immutable ordered container like Tuple (and Tuple is 
> recognized):
> `x.subs([Tuple(x,1)]) = 1`. It seems like a natural way to pass the 
> information and doesn't require the user to know about `args` in order to 
> pass it as `Eq(x,1).args` (as is currently the case.
>
> Other comments are in the PR link given above.
>
> /c
>
> --
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sympy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sympy/f38dee22-4249-4c3f-ac77-22a34a2f7e23n%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAKgW%3D6JgLvrewGLPRW45EBH85yozKpCz75ibD%2B%3DDEo6HVBj8CA%40mail.gmail.com.


[sympy] allowing Eq as recognized subs argument?

2024-03-27 Thread Chris Smith
In https://github.com/sympy/sympy/pull/26399 there is proposal to allow 
`subs` to recognize `Eq` so ` x.subs(x, 1) = x.subs( Eq(x, 1) ) = x.subs( [ 
Eq(x, 1) ] ) = 1` but `x.subs(Eq(1, x)) = x`.

It would be good to see if there is any strong senitment and rationale for 
or against this.

In favor, `Eq` is an immutable ordered container like Tuple (and Tuple is 
recognized):
`x.subs([Tuple(x,1)]) = 1`. It seems like a natural way to pass the 
information and doesn't require the user to know about `args` in order to 
pass it as `Eq(x,1).args` (as is currently the case.

Other comments are in the PR link given above.

/c

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/f38dee22-4249-4c3f-ac77-22a34a2f7e23n%40googlegroups.com.