------------
Date: 19th Sep 2008
^^^^^^^^^^^^^^^^^^^
Changes since 0.4.x
^^^^^^^^^^^^^^^^^^^
**General**
* Access to all important object attributes in all netaddr classes now takes
place via custom Python descriptor protocol classes. This has greatly
simplified internal class logic and made external attributes changes much
safer and less error prone. It has also made aggregate classes such as CIDR
and Wildcard effectively read-write rather than read-only which they have
been up until this release.
* Amended the way sort order is calculated for Addr and AddrRange (sub)class
instances so that the address type is taken into account as well as as the
numerical value of the address or address range. The ascending sort order
is IPv4, IPv6, EUI-48 and EUI-64. Sequences of AddrRange (sub)class
instances now sort correctly!
* Comparisons between instances of Addr and AddrRange (sub)classes now return
False, rather than raising an AttributeError.
* Added checks and workaround code for Python runtime environments that suffer
from the infamous socket module inet_aton('255.255.255.255') bug. This was
discovered recently in Python 2.4.x on PowerPC under MacOS X. The fix also
applies in cases where the socket module is not available (e.g. on Google
App Engine).
* All general Exception raising in the strategy module has now been replaced
with more specific exceptions, mainly ValueError (these were unintentionally
missed out of the 0.4 release).
* Implemented __hash__() operations for the Addr and AddrStrategy classes. This
allows you to use IP, CIDR and Wildcard objects as keys in dictionaries and
as elements in sets. Please note - this is currently an experimental feature
which may change in future releases.
* Added __ne__() operation to Addr and AddrRange classes.
* Obeying the 'Law of Demeter', the address type of Addr and AddrRange
(sub)class instances can be accessed using the property directly :-
obj.addr_type 0.5 onwards
rather than having to go via the strategy object :-
obj.strategy.addr_type 0.4 and earlier
* Renamed the AT_DESCR lookup dictionary to AT_NAMES. Removed invalid and
duplicated imports from all modules.
**Addr class changes**
* Removed the setvalue() method from the Addr class and replaced all uses of
__setattr__() replaced by custom descriptors throughout.
**IP class changes**
* Removed the ambiguity with masklen and prefixlen attributes in the IP class.
prefixlen now denotes the number of bits that define the netmask for an IP
address. The new method netmask_bits() returns the number of non-zero bits
in an IP object if the is_netmask() method returns True. A prefixlen value
other than /32 for an address where is_netmask() returns True is invalid
and will raise a ValueError exception.
* Removed the family() method from the IP class. It duplicates information
now provided by the prefixlen property.
* IP class has several new methods. is_multicast() and is_unicast() quickly
tell you what category of IP address you have and while ipv4() and ipv6()
act as IPv4 <-> IPv6 conversions or copy constructors depending on context.
* Reverse DNS lookup entries now contain a trailing, top-level period (.)
character appended to them.
* Added the hostname() method to IP instances which performs a reverse DNS
* The IP class __str__() method now omits the subnet prefix is now implicit
for IPv4 addresses that are /32 and IPv6 addresses that are /128. Subnet
prefix is maintained in return value for all other values.
**AddrRange class changes**
* The AddrRange class no longer stores instances of Addr (sub)classes for the
first and last address in the range. The instance variables self.start_addr
and self.stop_addr have been renamed to self.first and self.last and the
methods obj.first() and obj.last() have been removed.
Instead, self.first and self.last contain integer values and a reference
to a strategy object is stored. Doing this is a lot more useful and cleaner
for implementing internal logic.
To get Addr (sub)class objects (or strings, hex etc when manipulating the
the klass property) use the index values obj[0] and obj[-1] as a substitute
for obj.first() and obj.last() respectively.
* AddrRange (sub)class instances now define the increment, __iadd__(), and
decrement, __isub__(), operators. This allows you to 'slide' CIDRs and
Wildcards upwards and downwards based on their block sizes.
* The _retval() method has now been renamed data_flavour() - yes, the UK
spelling ;-) You shouldn't really care much about this as it mostly for
internal use. I gave it a decent name as I didn't see any real need to hide
the functionality if users wanted it.
**CIDR class changes**
* The strictness of the CIDR class constructor in relation to non-zero bits
once the prefix bitmask has been applied can be disabled use the optional
argument strict_bitmask=False. It is True (strictness enabled) by default.
* Fixed a bug in abbreviated CIDR conversion. Subnet prefix for multicast
address 224.0.0.0 is now /4 instead of /8.
* The CIDR class now supports subtraction between two CIDR objects, returning
a list of the remainder. Please note that the bigger of the two CIDR objects
must be on the left hand side of the the expression, otherwise an empty list
is return. Sorry, you are not allowed to create negative CIDRs ;-)
* The function abbrev_to_cidr() has been renamed to and turned into the static
method CIDR.abbrev_to_verbose(). No major changes to the logic have been
made.
**Wildcard class changes**
* The Wildcard class now defines a static method Wildcard.is_valid() that
allows you to perform validity tests on wildcard strings without fully
instantiation a Wildcard object.
------------