#17138: LatticePoset: complements() is broken
-------------------------------------+-------------------------------------
Reporter: jmantysalo | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-6.4
Component: combinatorics | Resolution:
Keywords: | Merged in:
Authors: Jori Mäntysalo | Reviewers: Nathann Cohen
Report Upstream: N/A | Work issues:
Branch: | Commit:
public/latticeposet__complements___is_broken|
cf4f72988a9910e9e64bbef4653524b59af5c67b
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by ncohen):
* status: needs_work => needs_review
* commit: 96c951514a8acca854f812a9225af0b864e3aa41 =>
cf4f72988a9910e9e64bbef4653524b59af5c67b
* branch: u/jmantysalo/latticeposet__complements___is_broken =>
public/latticeposet__complements___is_broken
Comment:
No, that would not work. Here is the reason:
1) The order in which elements are listed when you iterate upon the
elements of a dictionary is architecture-dependent. If you write a doctest
that just 'displays' the content of a dictionary, it will break on some
machines. The problem is not only the order of the lists of complements.
2) Actually, there is in Sage a 'hack' that reorders the entry of a
dictionary before they are displayed. I expect that it uses a 'sort' or
something, which works fine if you have only integers or only strings as
keys to your dictionary. On the other hand, Volker says that comparing int
and strings can be architecture dependent, as it is probably done
according to the memory locations
3) I believe that "random order" should be just "random"
I added a commit which does some non-architecture-dependent checks on the
output of the function. Tell me what you think, and you can set the ticket
to `positive_review` if you agree with it !
Thanks,
Nathann
----
New commits:
||[http://git.sagemath.org/sage.git/commit/?id=cf4f72988a9910e9e64bbef4653524b59af5c67b
cf4f729]||{{{trac #17138: Dangerous doctest}}}||
--
Ticket URL: <http://trac.sagemath.org/ticket/17138#comment:18>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.