(self, other)
return True
Returns true iff this tag has the same name, the same attributes,
        and the same contents (recursively) as the given tag.

        NOTE: right now this will return false if two tags have the
        same attributes in a different order. Should this be fixed?
Returns true iff this tag has the same name, the same attributes,
        and the same contents (recursively) as the given tag.
Returns true iff this tag has the same name the same attributes and the same contents ( recursively ) as the given tag .
def __eq__(self, other):
        """Returns true iff this tag has the same name, the same attributes,
        and the same contents (recursively) as the given tag.

        NOTE: right now this will return false if two tags have the
        same attributes in a different order. Should this be fixed?"""
        if other is self:
            return True
        if not hasattr(other, 'name') or not hasattr(other, 'attrs') or not hasattr(other, 'contents') or self.name != other.name or self.attrs != other.attrs or len(self) != len(other):
            return False
        for i in xrange(0, len(self.contents)):
            if self.contents[i] != other.contents[i]:
                return False
        return True
def __eq__ ( self , other ) : if other is self : return True if not hasattr ( other , 'name' ) or not hasattr ( other , 'attrs' ) or not hasattr ( other , 'contents' ) or self . name != other . name or self . attrs != other . attrs or len ( self ) != len ( other ) : return False for i in xrange ( 0 , len ( self . contents ) ) : if self . contents [ i ] != other . contents [ i ] : return False return True