(self, other)
return naive_equality or self.normalized_equality(other_ref)
Compare this reference to another.
Compare this reference to another.
Compare this reference to another .
def __eq__(self, other):
        """Compare this reference to another."""
        other_ref = other
        if isinstance(other, tuple):
            other_ref = URIReference(*other)
        elif not isinstance(other, URIReference):
            try:
                other_ref = URIReference.from_string(other)
            except TypeError:
                raise TypeError(
                    'Unable to compare URIReference() to {0}()'.format(
                        type(other).__name__))

        # See http://tools.ietf.org/html/rfc3986#section-6.2
        naive_equality = tuple(self) == tuple(other_ref)
        return naive_equality or self.normalized_equality(other_ref)
def __eq__ ( self , other ) : other_ref = other if isinstance ( other , tuple ) : other_ref = URIReference ( * other ) elif not isinstance ( other , URIReference ) : try : other_ref = URIReference . from_string ( other ) except TypeError : raise TypeError ( 'Unable to compare URIReference() to {0}()' . format ( type ( other ) . __name__ ) ) # See http://tools.ietf.org/html/rfc3986#section-6.2 naive_equality = tuple ( self ) == tuple ( other_ref ) return naive_equality or self . normalized_equality ( other_ref )