uri
uri copied to clipboard
Support and utilise native IP address representations.
https://docs.python.org/3/library/ipaddress.html
This would pair well with exposing the host part as either an FQDN object or an IP address object, for any URI scheme where the host can be unambiguously interpreted as one of those two.
I'm actually here because I was going to open an issue suggesting a bigger breaking-change improvement, and my suggestion was going to include this (parsing the host part as either an FQDN or IP for the URI schemes that it makes sense for, and then presenting it as those objects).
Of course sometimes host
parts aren't either an IP address nor an "FQDN" per se (like, is localhost
an FQDN? I wouldn't normally think to classify it as one).
So maybe the right name for such an object isn't "FQDN". Or maybe it's appropriate to categorize the host into three or more types of thing - FQDN, IP address, and something else.