
Antoine Pitrou wrote:
Peter Moody <peter <at> hda3.com> writes:
the address with all of the hosts bits masked to zero is most commonly referred to as the network address. same as the address with all of the host bits set to one is called the broadcast address. calling it something like base_address or min_address will cause quite a bit more confusion.
Quite a bit less IMO. I'm not a network specialist, but the "network address"
Nah, network address is perfectly explicit - it's what you get when you bitwise and any host within that network with the netmask. Where it becomes confusing is that we have a property called "network" that returns an IPAddress object rather than an IPNetwork object. People that are network specialists would grasp that fairly easily, but we try to design standard library APIs so that they're novice friendly as well. And the above situation isn't novice friendly. To be honest, given the indexing behaviour, I'm -1 on the idea of giving the network address or broadcast address attribute names *at all*. Consider: network_address = my_net[0] broadcast_address = my_net[-1] The only way the network address could match the number of characters in the indexing method is if you just called it the network id (i.e. my_net.id). For the broadcast address, there is no name that even comes close to matching the indexing approach for brevity. And since IPNetwork is a container for IPAddress instances, the indexing approach means there is zero ambiguity regarding the return type. Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia ---------------------------------------------------------------