node.example.com Is An IP Address
https://tuckersiemens.com/posts/node-example-com-is-an-ip-address/ [tuckersiemens.com]
2020-12-30 02:19
This takes a bit to get to the punchline, but man, good old duck typing for the win.
It turns out that, under certain conditions, the ipaddress module can create IPv6 addresses from raw bytes. My assumption is that it offers this behavior as a convenient way to parse IP addresses from data fresh off the wire.
Does node.example.com meet those certain conditions? You bet it does. Because we’re using Python 2 it’s just bytes and it happens to be 16 characters long.
source: L