(scheme, host, port)
Returns the host component, with a port specifcation if needed.
Returns the host component, with a port specifcation if needed.
Returns the host component with a port specifcation if needed .
def hostport(scheme, host, port):
    """
        Returns the host component, with a port specifcation if needed.
    """
    if (port, scheme) in [(80, "http"), (443, "https")]:
        return host
    else:
        return "%s:%s"%(host, port)
def hostport ( scheme , host , port ) : if ( port , scheme ) in [ ( 80 , "http" ) , ( 443 , "https" ) ] : return host else : return "%s:%s" % ( host , port )