Thierry wrote:
> Note that there are not only "mathemathical" orderings, but also
> "algorithmic" ones. It is useful (and i bet assumed in various Sage
> algorithms) to be able to totally order any pair of Python objects,
> e.g. when you want to traverse a graph, or even identify edges:
>
> sage: Graph({2:['a']}).edges(labels=False)
> [(2, 'a')]
> sage: Graph({'a':[2]}).edges(labels=False)
> [(2, 'a')]
> sage: 2 < 'a'
> True
Yes, but that's essentially the difference between comparison and cmp()
(at least in the current best practice as I understand it).
And indeed, when the order is not going to be presented to the user, it
is probably better to compare id()s in this case.
--
Marc
--
You received this message because you are subscribed to the Google Groups
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.