(self, port)
The port value can be 1-65535 or None, meaning no port specified. If
        <port> is None and self.scheme is a known scheme in DEFAULT_PORTS,
        the default port value from DEFAULT_PORTS will be used.

        Raises: ValueError on invalid port.
The port value can be 1-65535 or None, meaning no port specified. If
        <port> is None and self.scheme is a known scheme in DEFAULT_PORTS,
        the default port value from DEFAULT_PORTS will be used.
The port value can be 1 - 65535 or None meaning no port specified . If <port > is None and self . scheme is a known scheme in DEFAULT_PORTS the default port value from DEFAULT_PORTS will be used .
def port(self, port):
        """
        The port value can be 1-65535 or None, meaning no port specified. If
        <port> is None and self.scheme is a known scheme in DEFAULT_PORTS,
        the default port value from DEFAULT_PORTS will be used.

        Raises: ValueError on invalid port.
        """
        if port is None:
            self._port = DEFAULT_PORTS.get(self.scheme)
        elif is_valid_port(port):
            self._port = int(str(port))
        else:
            raise ValueError("Invalid port '%s'." % port)
def port ( self , port ) : if port is None : self . _port = DEFAULT_PORTS . get ( self . scheme ) elif is_valid_port ( port ) : self . _port = int ( str ( port ) ) else : raise ValueError ( "Invalid port '%s'." % port )