def __repr__(self):
        """Return string representation of the class."""
        if self.username is None:
            repr_str = "{}://{}:{}".format(self.protocol, self.hostname, self.port)
        else:
            repr_str = "{}://{}@{}:{}".format(self.protocol, self.username, self.hostname, self.port)
        return repr_str
def __repr__ ( self ) : if self . username is None : repr_str = "{}://{}:{}" . format ( self . protocol , self . hostname , self . port ) else : repr_str = "{}://{}@{}:{}" . format ( self . protocol , self . username , self . hostname , self . port ) return repr_str
Return string representation of the class.