In addition to that I've been using the idiom

MyOutput == {this : dict}
True

And that works for tests and renders well on documents

R

On February 4, 2021 8:34:36 PM GMT-03:00, 'Travis Scrimshaw' via sage-devel 
<sage-devel@googlegroups.com> wrote:
>Hi John,
>IIRC, a dict has its keys automatically sorted in the output. However, 
>if the dict is inside of another object, then no sorting is done. So if
>it 
>is a simple dict with a total ordering on the keys, then you can simply
>put 
>the output. You can also run sorted() on the items if they dicts are
>inside 
>of other objects. Otherwise you might be better off testing the
>individual 
>aspects you want, such as specific values are correct. Could you point
>to 
>which ticket and/or test you want?
>
>Best,
>Travis
>
>
>On Friday, February 5, 2021 at 3:06:52 AM UTC+10 john.c...@gmail.com
>wrote:
>
>> Can someone remind me the preferred way to get doctests to pass when
>> the output -- which we do want to include in the docstring --
>includes
>> a dict whose keys come out in random order?
>>
>> John
>>
>
>-- 
>You received this message because you are subscribed to the Google
>Groups "sage-devel" group.
>To unsubscribe from this group and stop receiving emails from it, send
>an email to sage-devel+unsubscr...@googlegroups.com.
>To view this discussion on the web visit
>https://groups.google.com/d/msgid/sage-devel/9ef9c6c5-f76c-4853-a1d9-e7302d7aec75n%40googlegroups.com.

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sage-devel/4E26E6C9-2542-4B66-933E-72C553FFEB00%40potuz.net.

Reply via email to