'>>> uri = URL(\'http://www.google.com/\')
>>> r = HTTPResponse(200, \'\' , Headers(), uri, uri)
>>> r.set_uri(\'http://www.google.com/\')
Traceback (most recent call last):
TypeError: The URI of a HTTPResponse object must be of url.URL type.
>>> r.set_uri(uri)
>>> r.get_uri() == uri
True'

def set_uri(self, uri):

    if (not isinstance(uri, URL)):
        raise TypeError('The    URI    of    a    HTTPResponse    object    must    be    of    url.URL    type.')
    self._uri = uri
    self._realurl = uri.uri2url()
