R. David Murray <[email protected]> added the comment:
In pre-CIDR days, assuming a prefixlen of 24 for a 192.168.x.x address
made sense. Nowadays it is better not to make that assumption. So I
find ipaddr's default of 32 to be "safer" than using a class based default.
The larger point, however, is that there _is_ a mask associated with the
address in ifconfig. There _must_ be one. So that is not an example
that shows that a separate address class is useful.
As for the == thing, I agreed with you that address compared to network,
if you had an address class, would yield false. My point was that
HypotheticalNetworkClass('192.168.1.1') ==
HypotheticalNetworkClass('192.168.1.1/32')
should yield True, because, as I said above, in a CIDR world using a
default of a hostmask for an otherwise unadorned address makes the most
sense.
As for an example of when the equivalence is useful, it is useful every
time I set up an access rule or route that applies to a single host.
Otherwise, I _must_ give a specific netmask, because in real life the
classfull default is often not the correct netmask. Most networking
software that I've dealt with requires explicit netmasks (often with a
shorthand to specify an ip/hostmask pair). It is true that when a
netmask isn't required it generally defaults to the classful netmask,
but having such a default is becoming more rare with time, in my
experience (because of CIDR).
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue3959>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com