#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 ncohen):

 Hello !

 - depreceated -> deprecated

 - `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.

 - (Do as you like but) the "comps" loop could have been rewritten as
 {{{
 return {self._vertex_to_element(u):map(self._vertex_to_element,l)
         for u,l in c.iteritems()
         if l}
 }}}

 - Why do you test `cardinality==0` instead of `if x not in self` ?

 - {{{for x in self.list()}}} can also be written {{{for x in self}}}

 Nathann

--
Ticket URL: <http://trac.sagemath.org/ticket/17138#comment:5>
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.

Reply via email to