Hi Rob! On Sep 21, 2:15 am, Rob Beezer <goo...@beezer.cotse.net> wrote: > sage: g = Graph() > sage: g.add_vertices(Subsets(3,2)) > sage: g.vertices() > [{2, 3}, {1, 2}, {1, 3}] > sage: sorted(g.vertices()) > [{1, 3}, {1, 2}, {2, 3}] > sage: Subsets(3,2).list() > [{1, 2}, {1, 3}, {2, 3}] > sage: sorted(Subsets(3,2).list()) > [{2, 3}, {1, 3}, {1, 2}]
I think the problem is that there is no proper ordering defined for sage.sets.set.Set_object_enumerated: sage: S = Subsets(3,2).list()[0] sage: T = Subsets(3,2).list()[1] sage: S {1, 2} sage: T {1, 3} sage: type(S) <class 'sage.sets.set.Set_object_enumerated'> sage: S < T True sage: T < S True sage: S==T False So, unless someone implements __cmp__ (or similar) methods for Set_object_enumerated, you can't expect to get anything meaningful out of the sorting. Best regards, 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 -~----------~----~----~----~------~----~------~--~---