Interesting as evidence of classful IPv4
behaviour seems fairly pervasive in current IP stacks and software that supports IPv4 addressing (e.g. PostgreSQL inet and cidr data types).
Here's an excerpt from the 'ifconfig' man page (taken from an Ubuntu 9.04 install) :-
^^^^^^^^^^^^^^^^^^^^^^^
...
netmask addr
Set
the IP network mask for this interface. This value defaults to the
usual class A, B or C network mask (as derived from the interface IP
address). but it can be set to any value.
...
^^^^^^^^^^^^^^^^^^^^^^^
The point being that you can't always assume /32 implicitly for all use cases.
Here is how IP addresses without an explicit prefix or netmask are currently handled :-
>>> import ipaddr
>>> ipaddr.IPv4Network('10.0.0.1')
IPv4Network('
10.0.0.1/32')
It may not be something we want to support (you could always force the end user to specify a prefix or netmask explicitly). This is fair enough, but let's indicate that it's a considered choice. Somewhere in the PEP text is might be a good place for treatment of this topic.