The issue stems from this: sage: Poset(b) Finite lattice containing 1 elements sage: a == b False
The first behavior is a feature, as b already knows it is a lattice, so b should act be an idempotent wrt to Poset. IMO, the equality a == b should be true as knowing you're a lattice is just extra information, but not part of the structure. However, it is a drawback of posets being unique representations as we don't want to check for being a lattice when passing data. So I'm thinking what the lattice code should do is create the poset object, and then add the lattice classes to the MRO of the returned object. AFAIK, this should play nicely with the unique representation behavior and fix the issue at hand. The alternative is instead of checking for subclasses, check for exact class equality in Poset. We might also want to consider moving over to a UniqueFactory. Best, Travis On Wednesday, September 30, 2015 at 5:23:12 AM UTC-5, Jori Mäntysalo wrote: > > Is this a feature or a bug? > > a = Poset({1:[]}) > b = LatticePoset({1:[]}) > c1 = Poset(b) > c2 = Poset(b.hasse_diagram()) > a==c1, a==c2 > > outputs False, True. But this is quite a surprise for a user. > > -- > Jori Mäntysalo > -- 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 http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.