[3/6] let's remove multiple inheritance (NoRelMeths)
commit0ec41c9e039c555da188e47eb819c811228fea19
authorKirill Smelkov <kirr@landau.phys.spbu.ru>
Fri, 8 Aug 2008 15:52:52 +0000 (8 19:52 +0400)
committerKirill Smelkov <kirr@landau.phys.spbu.ru>
Fri, 8 Aug 2008 15:52:52 +0000 (8 19:52 +0400)
tree4ba1fa628c0313c60f748bf4e4cdf2ebea9f2eec
parent0d3b0ebd45f2d6941062236704eb53404500a199
[3/6] let's remove multiple inheritance     (NoRelMeths)

Kill NoRelMeths

In Python 2.1 they added rich comparisons [1] and "a < b" should be always
meaningful for all objects.

However, in Python 3000, they are going to rework it [2], [3], so now:

    Comparisons other than == and != between disparate types will raise an
    exception unless explicitly supported by the type

Now let's get back to SymPy.

Originally NoRelMeths were there to indicate "no relation methods at all - just
raise."

Then we added sense to __lt__ even in NoRelMeths because of problems py.test
had with such a behaviour  -- see

    #103  (Basic.__lt__ and Basic.__gt__ and "py.test -l")

In another issue

    #454  (__lt__ should work in the pythonic way)

we were discussing about how to thing the Pythonic way, and here I propose:

    Let's remove NoRelMeths altogether

Look, now all objects are comparable, but we return Eq,Gt,Ge,etc ... instances
for cases where we can't say True/False.

I think this makes a lot of sense, consider old and new behaviour:

        old                             new

In [1]: Limit(x, x, 0) > oo     In [1]: Limit(x, x, 0) > oo
Out[1]: True   (huh!?)          Out[1]:
                                ∞ < lim x
                                    x->0

So let's just do it.

[1] http://www.python.org/dev/peps/pep-0207/
[2] http://www.python.org/dev/peps/pep-3100/#id18
[3] http://mail.python.org/pipermail/python-dev/2004-June/045111.html

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Ondrej Certik <ondrej@certik.cz>
sympy/concrete/products.py
sympy/concrete/summations.py
sympy/core/methods.py
sympy/core/numbers.py
sympy/core/relational.py
sympy/integrals/integrals.py
sympy/polys/rootfinding.py
sympy/series/limits.py
sympy/utilities/tests/test_pickling.py