As you can see, it is used in BasicMeta.__cmp__ several lines lower.
I did some playing around with this. It's currently used in two main
places. First, because BasicMeta doesn't define __eq__, it uses
__cmp__ to compute == comparison. If you define an equivalent __eq__,
i.e.,
def __eq__(cls, other):
if not isinstance(other, BasicType):
return False
return cls.__name__ == other.__name__
Then this is no longer an issue.
The other place is in Basic.compare, which is used for the old
printing ordering, but also in other places, such as Mul.flatten (line
501).
This is unfortunate, because this is clearly a terrible design, and a
quick glance at the list shows that it not only doesn't include all
classes in SymPy, it includes several that no longer exist.
So we clearly need to figure out what needs to be done to remove this.
If this means removing the old printing ordering, that's fine (see
http://code.google.com/p/sympy/issues/detail?id=1491). There's also a
similar construct in geometry that should be removed as well.
Aaron Meurer
On Fri, May 4, 2012 at 1:41 PM, [email protected]
<[email protected]> wrote:
> Can somebody give more details about line 6 in core.p?
>
> 6 # FIXME this is *so* irrelevant and outdated!
>
> What follows is a big list named ordering_of_classes that is used in
> the __cmp__ method of the BaseBlahblah classes.
>
> --
> 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.