#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:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jmantysalo/latticeposet__complements___is_broken|
36dd2f336b1b22690a0e292147db26ccadc4a5ac
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by jmantysalo):
Replying to [comment:5 ncohen]:
> - depreceated -> deprecated
> - {{{for x in self.list()}}} can also be written {{{for x in self}}}
Done this.
> - (Do as you like but) the "comps" loop could have been rewritten as - -
This says `AttributeError: 'list' object has no attribute 'iteritems'`.
> - Why do you test `cardinality==0` instead of `if x not in self` ?
Running `meet()` or `join()` will check that element belongs to the
lattice, the only exception is empty lattice. (Well, partly because of
that the code is non-optimal. But at least it works.)
> - `Use FiniteLattices::complements()` -- this is not C++ ! Plus the
message should probably be "complements() is only defined on LatticePoset"
or something. I mean, an error message telling the user that he should
change the poset's type itself.
>
> - Given how broken that function is, perhaps it is better to raise an
exception rather than a warning.. What do you think ? Besides, that
function is defined in `HasseDiagram` which are not really meant to be
used directly anyway.
I don't know. Can function from `HasseDiagram` be directly deleted without
deprecating it first? For now I changed phrasing in the message.
--
Ticket URL: <http://trac.sagemath.org/ticket/17138#comment:6>
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.