示例#1
0
    def __eq__(self, other):
        """Equality test.

        other -- ISeq or something that implements the seq protocol

        ASeq.__eq__ is actually used."""
        return (self is other
                or (RT.isSeqable(other)
                    and not isinstance(other, (IPersistentSet, IPersistentMap))
                    and self.seq() == RT.seq(other)))
    def __eq__(self, other):
        """Equality test.

        other -- ISeq or something that implements the seq protocol

        ASeq.__eq__ is actually used."""
        return (self is other or
                (RT.isSeqable(other) and
                 not isinstance(other, (IPersistentSet, IPersistentMap)) and
                 self.seq() == RT.seq(other)))
示例#3
0
    def __eq__(self, other):
        """Equality test.

        other -- ISeq or something that implements the seq protocol

        ASeq.__eq__ is actually used."""
        if self is other:
            return True
        if not RT.isSeqable(other) or isinstance(other, IPersistentSet):
            return False
        s = self.seq()
        o = RT.seq(other)
        return s == o
示例#4
0
    def __eq__(self, other):
        """Equality test.

        other -- ISeq or something that implements the seq protocol

        ASeq.__eq__ is actually used."""
        if self is other:
            return True
        if not RT.isSeqable(other) or isinstance(other, IPersistentSet):
            return False
        s = self.seq()
        o = RT.seq(other)
        return s == o
示例#5
0
 def __eq__(self, other):
     if self is other:
         return True
     if not RT.isSeqable(other) or (isinstance(other, IPersistentSet)):
         return False
     se = RT.seq(other)
     if isinstance(se, RT.NotSeq):
         print other, type(other)
         return False
     ms = self.seq()
     while se is not None:
         if ms is None or not se.first() == ms.first():
             return False
         ms = ms.next()
         se = se.next()
     return ms is None
示例#6
0
 def __eq__(self, other):
     if self is other:
         return True
     if not RT.isSeqable(other) or isinstance(other, IPersistentSet):
         return False
     se = RT.seq(other)
     # XXX: don't think this is used
     # if isinstance(se, RT.NotSeq):
     #     print other, type(other)
     #     return False
     ms = self.seq()
     while se is not None:
         if ms is None or not se.first() == ms.first():
             return False
         ms = ms.next()
         se = se.next()
     return ms is None
 def __eq__(self, other):
     s = self.seq()
     if not RT.isSeqable(other) or isinstance(other, IPersistentSet):
         return False
     o = RT.seq(other)
     return s == o
示例#8
0
 def __eq__(self, other):
     s = self.seq()
     if not RT.isSeqable(other):
         return False
     o = RT.seq(other)
     return s == o