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