Netloc in its full form can have HTTP authentication credentials and a port number:
login:password@www.google.co.uk:80
So we potentially have to split that into ["login:password", "www.google.co.uk:80"]
, take the last part, split that into ["www.google.co.uk", "80"]
and take the hostname.
If these parts are omitted, there's no harm in trying to split on nonexisting delimeters, and no need to check if they're omitted or not.