def __init__(self, url):
        """Constructor.

        :param url: can be either of str or bytes type.
        """
        if self.__py3:
            if type(url) is bytes:
                self.url = bytes(url)
            else:
                self.url = url.encode()
        else:
            self.url = str(url)
def __init__ ( self , url ) : if self . __py3 : if type ( url ) is bytes : self . url = bytes ( url ) else : self . url = url . encode ( ) else : self . url = str ( url )
Constructor.

        :param url: can be either of str or bytes type.