Hi!

On Sep 21, 10:22 am, Simon King <simon.k...@nuigalway.ie> wrote:
[...]
> So, unless someone implements __cmp__ (or similar) methods for
> Set_object_enumerated, you can't expect to get anything meaningful out
> of the sorting.

If your question is just about getting *some* unique result (say, for
a doc test): You can sort the elements of your list first, and then
you have a list of list (rather than a list of sets) that you can sort
in a unique way.

  sage: g = Graph()
  sage: g.add_vertices(Subsets(3,2))
  sage: g.vertices()
  [{2, 3}, {1, 2}, {1, 3}]
  sage: sorted([sorted(list(V)) for V in g.vertices()])
  [[1, 2], [1, 3], [2, 3]]
  sage: Subsets(3,2).list()
  [{1, 2}, {1, 3}, {2, 3}]
  sage: sorted([sorted(list(V)) for V in Subsets(3,2)])
  [[1, 2], [1, 3], [2, 3]]

Cheers,
Simon

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to