Updates:
        Labels: -NeedsBetterPatch NeedsReview

Comment #3 on issue 1924 by smichr: Eq() gets .as_basic() method
http://code.google.com/p/sympy/issues/detail?id=1924

This isn't a new proposal for a new function, so please look beyond the name...or think of it this way: there are ints and there are Integers and there are basics and Basics. Eq and Poly are Basic but not basic. Here (including my own) are places such
definitions already appear:

core\basic.py:    def as_basic(self):
core\relational.py:    def as_basic(self):
polys\algebratools.py:        def as_basic(f):
polys\numberfields.py:    def as_basic(self, x=None):
polys\polytools.py:    def as_basic(f, *gens):

As to the point, it's sugar (that you don't have to use if you don't like) which
allows you to replace:

if isinstance(eq, Eq):
    eq = eq.lhs - eq.rhs

with

eq = eq.as_basic()

And the point (besides cleaner code) is to be able to put this at the head of routines where it matters and know (like when using S(expr) at the head of a routine) that from that point on you are using a normal expression--a basic Basic--not an Eq. And for some routines it is important to have the equation in that form. For example,
in ode and solve if you simplify an Eq() nothing is going to happen:

from sympy import *
var('x')
x
simplify(x*(x-1))
-x + x**2
simplify(Eq(x*(x-1)))
-x*(1 - x) == 0

Please reconsider. You can see the commit for the several places that this has been
utilized in existing code.

Seeing no "second opinion" label for the review process, I simply put this back to
NeedsReview.

--
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 sympy-iss...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to