Hi there!

I'm trying to understand inheritance.  In formal_sum I find the following 
code:

class FormalSums(UniqueRepresentation, Module):

    Element = FormalSum

    def _element_constructor_(self, x, check=True, reduce=True):

        if isinstance(x, FormalSum):
            P = x.parent()
            if P is self:
                return x
            elif P == self:
                return self.element_class(x._data, check=False, 
reduce=False, parent=self)
            else:
                x = x._data

I do not understand 
this: 
http://doc.sagemath.org/html/en/reference/structure/sage/structure/unique_representation.html#sage.structure.unique_representation.UniqueRepresentation
gives me the impression that "P is self" and "P == self" should be the same 
thing.  Is my impression wrong or is the code above misleading?

Thanks,

Martin

-- 
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 [email protected].
To post to this group, send email to [email protected].
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