On Wed, 16 Sep 2009 at 20:26, Peter Moody wrote:
On Wed, Sep 16, 2009 at 7:48 PM, Greg Ewing <greg.ew...@canterbury.ac.nz> wrote:
I'm not sure what usefulness the zero address on its own
has, but if it's considered useful enough to have an
attribute for it, calling it something like 'base_address'
would be less confusing.
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.
If 'network address' is the most common designation for this number
(and it may well be), then 'network.address' and 'network.broadcast'
would seem to be the best choices for names. But there is definitely
an attraction to the idea (I think it was Nick's?) of dropping these
attributes entirely and just using indexing to get the addresses.
That will make perfect sense to network professionals, and by putting
appropriate words in the documentation will educate people new to IP
addressing concepts. The advantage is that it is completely unambiguous:
the network address really is the first address in the network range,
and the broadcast really is the last, in common usage. Exceptional cases
can then be handled by custom subclasses, without having someone who
has to handle weird broadcast addresses (for example) submitting a bug
request to make '.broadcast' settable.
--David
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com