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
On Wed, Sep 1, 2010 at 11:00 AM, Simon King simon.k...@nuigalway.ie wrote:
But then, what can one do? I.e., how can one safely doctest the
contents of a dictionary D?
You could build the dictionary and check that it is equal to the
dictionary in question:
sage: L
{360: {}, 2520: {0: 'X'},
Hi Mike!
On 1 Sep., 20:05, Mike Hansen mhan...@gmail.com wrote:
You could build the dictionary and check that it is equal to the
dictionary in question:
sage: L
{360: {}, 2520: {0: 'X'}, 'prime': 3}
sage: dict([(360, {}), (2520, {0: 'X'}), ('prime', 3)]) == L
True
Good idea!
Thank you,
On Sep 1, 11:00 am, Simon King simon.k...@nuigalway.ie wrote:
But then, what can one do? I.e., how can one safely doctest the
contents of a dictionary D?
If the default choice of sorted is not portable, make sure to tell
the system to sort on something that is portable, like you suggest:
At