The output of both dict and set are ordered by a display hook from IPython, 
the problem is that this sorting is done on the basis of __cmp__ and the 
default way of sorting using __cmp__ is using the id of an object which is 
not deterministic, so even though the output is sorted it is done on a 
nondeterministic basis for objects which have this nondeterministic __cmp__.

I see basically 2 options going forward:

1. Just fix the doctests of pynormaliz themselves by making them 
deterministic. 

2. Make the doctesting of sets more robust by ordering the output basted on 
the string representation instead of __cmp__ . This has two ways of doing 
it.
2.1 Only change the order of the output in the doctesting framework
2.2 Change it both in the doctesting framework and the user interface

At https://trac.sagemath.org/ticket/23586 there is a partial solution using 
2, I stopped working on this because I want feedback on wether we should do 
2.1 or 2.2. But the progress on this ticket is slow.

So I propose doing the quick fix 1 independently of 2, because this will 
remove a lot of false negatives of the patchbot on other tickets helping 
greatly in the sage development.

Do people have feedback on 2.1 vs 2.2? 
Main advantage of 2.1, the user will get more meaningful output in the case 
where __cmp__ is deterministic. For example with 2.2 the user will get the 
following awkward output:

    sage: set(GF(11)) 
    {0, 1, 10, 2, 3, 4, 5, 6, 7, 8, 9}

The main advantage of 2.2 is that the doctest and the actual output of sage 
are guaranteed to agree and that the code paths for doctesting and actual 
output are more similar.

My personal preference is for 2.1 since sets are inherently unordered, but 
I am open for feedback.

On Friday, 18 August 2017 09:14:55 UTC+2, Daniel Krenn wrote:
>
> A patchbot reported two failing doctests because the result is a set and 
> the elements were in a different order, see 
>   https://trac.sagemath.org/ticket/23637 
> <https://www.google.com/url?q=https%3A%2F%2Ftrac.sagemath.org%2Fticket%2F23637&sa=D&sntz=1&usg=AFQjCNHgNMW5ruZQKIa174ovsDnStqPcDA>
>  
> I somehow remember that such an issue was discussed here and I thought 
> it was about the output of dict and set being sorted by a display hook. 
> Am I wrong and this is not done or even not possible? 
>
> Best 
>
> Daniel 
>

-- 
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 post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to