Andrew McNamara writes: > Conceptually, you sometimes need a bare address, and other times, > you need an address with an associated network (host interface > configs, router configs, etc). By AddressWithMask, I really mean > AddressWithEnoughInformationToDeriveNetworkWhenNeeded. Conveniently, > IPv4 and IPv6 addressing allows us to derive the network from the > host That's precisely the claim I deny. Yes, you can derive the network *address* from a generic address and a mask. You cannot derive the *network* that way! Eg, suppose in a routing application you have class IPv4NetworkWithGateway(IPv4Network): ... oops. You want *the* IPv4Network instance that has all the gateway info, not just *any* IPv4Network instance that happens to have the same network address and mask. Address + mask is *not* sufficient to derive the desired IPv4Network instance. I grant that sometimes all you really care about is that the network address and the mask match; constructing on the fly would be sufficient. However, many of the applications I can think of attach additional attributes to IPv4Networks, and really do want "the real thing" vs. a constructed imitation.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4