Hi Mike!

On 1 Sep., 19:45, Mike Hansen <mhan...@gmail.com> wrote:
> It's always been somewhat machine dependent -- 
> seehttp://yz.mit.edu/wp/default-behavior-of-pythons-cmp/.

Ah! So, the problem is that I have both strings and integers, there is
no __cmp__ implemented that compares both, and thus the two are
compared by id, which is machine dependent.

But then, what can one do? I.e., how can one safely doctest the
contents of a dictionary D?

At least in this example,
  sage: sorted( [(repr(a),b) for a,b in D.iteritems()] )
should work. But it doesn't seem very elegant to me.

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

Reply via email to