On Apr 17, 1:08 pm, kcrisman <[EMAIL PROTECTED]> wrote:
> The point is that I'm not sure how to tell elements that they
> are greater than each other without defining a new class with _cmp_ or
> something, which would be the opposite of my goal of being able to
> dynamically assign an ordering to an arbitrary set.
I don't understand entirely what you want, but you can write your own
compare function ( def comp(x,y): ... returns {-1,0,1} ) and plug it
into the sort function of an array (a.sort(comp)). That's basic
python.
Then just the compare function defines the element ordering,
independent of the element class.
But maybe I missed your point, Harald
PS: If you know Java, that's a Comparator
--~--~---------~--~----~------------~-------~--~----~
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/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---